I've had a small group of Windows 2008 servers that I administer that are part of a larger domain in which I am not a domain admin. Out of curiosity, I was just trying to see if my servers were in a seperate OU or not. So, used Arend's ListOUObject function to try and list, but got nothing. Do you think it is likely they have restricted access to this information for domain admins, or is there a problem with my code?
 Code:
Break On
$=SetOption("Explicit","On")
$=SetOption("WrapAtEOL","On")
Dim $strADsPath, $strBeg, $strLDAP, $arrItems, $strItem
$strADsPath = GetObject("LDAP://rootDSE").Get("defaultNamingContext")
Include "functions.kix"
$strBeg = "LDAP://"
$strLDAP = $strBeg + "OU=Computers," + $strADsPath
$arrItems = ListOUObjects($strLDAP,"computer")
For Each $strItem In $arrItems
   ? $strItem
Next
$strLDAP = $strBeg + $strADsPath
$arrItems = ListOUObjects($strLDAP,"organizationalUnit")
For Each $strItem In $arrItems
   ? $strItem
Next


Edited by BradV (2014-01-29 05:40 PM)
Edit Reason: Fixed typo