PramodR Posted April 15, 2018 Posted April 15, 2018 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")
Developers Jos Posted April 15, 2018 Developers Posted April 15, 2018 Isn't using @LogonDomain easier? Jos PramodR 1 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.
PramodR Posted April 15, 2018 Author Posted April 15, 2018 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 ?
iamtheky Posted April 15, 2018 Posted April 15, 2018 can you just read the return from whoami? PramodR 1 ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
PramodR Posted April 15, 2018 Author Posted April 15, 2018 wes-k3j4pr20q4\admin - Domain name info from whoami. and domain value in system properties is linuxadmin.com.
Developers Jos Posted April 15, 2018 Developers Posted April 15, 2018 So you need to domain name of the domain to which the Computer was joined, not the domain of the logged in user? Jos PramodR 1 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.
iamtheky Posted April 15, 2018 Posted April 15, 2018 like "wmic computersystem get domain" PramodR 1 ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
Subz Posted April 16, 2018 Posted April 16, 2018 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 PramodR 1
PramodR Posted April 16, 2018 Author Posted April 16, 2018 Big Thanks Guys , @Subz your WMI query works perfectly in all condition.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now