Jump to content

How to read value from Windows System properties


PramodR
 Share

Recommended Posts

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")
Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

can you just read the return from whoami?

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

Link to comment
Share on other sites

  • Developers

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

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

like "wmic computersystem get domain"

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

Link to comment
Share on other sites

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

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...