Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

_AD_ListDomainControllers question

$
0
0
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

[ autoit ]      
_AD_Open() 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()
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.  

[ 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

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>