Hi - I use many of the AD.au3 functions regularly and usually have no issues however I am having difficulties with _AD_ListDomanControllers()
if I compile the following and RunAs from a device on the domain I want to query, everything works OK
However if I try and use the code below from another domain, I get @error = 1 'No Domain Controllers Found'. The account & password are a DA account and work with other queries.
The point of this exercise is to increase the reliability of a script we use daily which queries four domains. At present if the specified DC were to fail, the script would fail.
I know I can use netdom query to get the results I require but I would much rather keep this all within AutoIT. Any ideas greatly appreciated
Thanks
if I compile the following and RunAs from a device on the domain I want to query, everything works OK
[ autoit ]
[ autoit ]
_AD_Open("Domain\User", "password", "DC", "DC.FQDN", "CN=configuration") If @error Then MsgBox(16, "AD Error", "_AD_Open failed - Error = " & @error & ", @extended = " & @extended) Global $aDC = _AD_ListDomainControllers() If @error Then Exit MsgBox(16, "AD DC Error", "Error = " & @error) _ArrayDisplay($aDC, "Domain Controllers") _AD_Close()
The point of this exercise is to increase the reliability of a script we use daily which queries four domains. At present if the specified DC were to fail, the script would fail.
I know I can use netdom query to get the results I require but I would much rather keep this all within AutoIT. Any ideas greatly appreciated
Thanks