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

Help on converting a vbs script

$
0
0
Hello all,
Im trying to convert a vbs script I have. and I seems to be missing something. not sure what.
the intent, is to return the OU of a computer object, so I can use it later in the script:
Set objSysInfo = CreateObject("ADSystemInfo")
strComputer = objSysInfo.ComputerName
Set objComputer = GetObject("LDAP://" & strComputer)
arrOUs = Split(objComputer.Parent, ",")
arrMainOU = Split(arrOUs(1), "=")
Wscript.Echo arrMainOU(1)


AutoitCode that fails.
$objSysInfo = ObjCreate("ADSystemInfo")
$strComputer = $objSysInfo.ComputerName
$objComputer = ObjGet("LDAP://" & $strComputer)
MsgBox(4096, "", $objComputer.Parent)
$arrOUs = StringSplit($objComputer.Parent, ",")
MsgBox(4096, "", $arrOUs)
$arrMainOU = StringSplit($arrOUs(1), "=")
ConsoleWrite ($arrMainOU(1))


Viewing all articles
Browse latest Browse all 12506

Trending Articles



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