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:
AutoitCode that fails.
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))