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

AD 'ExecQuery' error

$
0
0
Hello Everyone,

I've ported over the following script from VBScript (where it works fine) to AutoIt:

[ autoit ]      
Dim $objDNS = ObjCreate("winMgmts:\\" & $strDNSServer & "\root\MicrosoftDNS") Dim $objRR = $objDNS.ExecQuery("SELECT * FROM MicrosoftDNS_ResourceRecord" & _ " WHERE ContainerName='" & $strDomainName & "' AND OwnerName='" & $strOwnerName & "'",,48)

I have to compile the script and run it on a PC where the logged on user has the appropriate AD privileges. When I attempt to compile it (with AU3Check turned on) I get the following error:

Quote

ERROR: syntax error
  " WHERE ContainerName='" & $strDomainName &"' AND OwnerName='" & $strOwnerName &"'",,
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

If I turn off AU3Check and go ahead and compile the code, on the PC (where I know permissions is NOT the issue because I can run the same VBScript-syntaxed code on the same PC successfully) I get the following runtime error:

Quote

AutoIT Error

Line 436 [there are only 84 lines of code] (File "C:\Test.exe"):

Error: Variable must be of type "Object".

Can someone please hep me?

Viewing all articles
Browse latest Browse all 12506

Trending Articles



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