Jump to content

Recommended Posts

Posted

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")
Posted
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 ?

Posted

can you just read the return from whoami?

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

Posted

like "wmic computersystem get domain"

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

Posted
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

 

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
  • Recently Browsing   0 members

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