Jump to content
PramodR

How to read value from Windows System properties

Recommended Posts

PramodR

I need to read domain name information available in the windows  sysdm.cpl using autoIT , Till now i am able to launch the console. I would really need help in proceeding further any help is appreciated.

I want to stick with AUTO IT to get the value, i inspect class value for the domain info using autoIT info which is #32770

Run("control.exe sysdm.cpl,,4")

Share this post


Link to post
Share on other sites
PramodR
Quote

 

Thanks for the suggestion, But Problem for this query to work domain has to be prefixed during login time along with username,  I wont be able to do that as system will do a automatic reboot and login... is there any way i can read domain information from client ?

Share this post


Link to post
Share on other sites
iamtheky

can you just read the return from whoami?

  • Thanks 1

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites
PramodR

wes-k3j4pr20q4\admin - Domain name info from whoami.

and domain value in system properties is  linuxadmin.com.

Share this post


Link to post
Share on other sites
Jos

So you need to domain name of the domain to which the Computer was joined, not the domain of the logged in  user?

Jos

  • Thanks 1

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
iamtheky

like "wmic computersystem get domain"

  • Like 1

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites
Subz
MsgBox(32, "Host Domain Name", "Example1: " & _GetDomainName1())
MsgBox(32, "Host Domain Name", "Example2: " & _GetDomainName2())

;~ Returns Workgroup or Domain Name
Func _GetDomainName1()
    Local $objWMISvc = ObjGet("winmgmts:\\.\root\cimv2")
    Local $colItems = $objWMISvc.ExecQuery("Select * from Win32_ComputerSystem")
    For $objItem In $colItems
        $strComputerDomain = $objItem.Domain
        If $objItem.PartOfDomain Then
            Return "Computer Domain: " & $strComputerDomain
        Else
            Return "Workgroup: " & $strComputerDomain
        EndIf
    Next
EndFunc

;~ Only works when computer is connected to a domain
Func _GetDomainName2()
    Local $objSysInfo = ObjCreate("AdSystemInfo")
    Return $objSysInfo.DomainDNSName
EndFunc

 

  • Thanks 1

Share this post


Link to post
Share on other sites
PramodR

Big Thanks Guys , @Subz your WMI query works perfectly in all condition.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×