Hey guys, thanks for indulging me on this problem. The problem was indeed the construction of the array used with the LDAP provider. Computers only do what you tell'm, and I told it to filter to "" which is apparently what I got. It bugs me though that WinNT: and LDAP: do not behave consistently but I guess that is asking alot from the folks in Redmond.
So back to the original reason for the post....
Shawn, since you couldn't read the Perl that actually contained "OLE", I translated it to KiXtart COM which you should be able to digest but the "OLE" fell out. Oh Well.
code:
break on
$count = EnumOUs("LDAP://us-tyco-e/OU=NCS, OU=Machines, DC=us, DC=tycoelectronics, DC=com", "computer")
? "There are $Count object(s) in the tree."
Function EnumOUs($LDAP, $Filter)
;$Filter = 'computer' | 'user'
dim $aFilter[0], $pos, $objOU, $i, $j
$i = 0
$j = 0
$aFilter[0] = $Filter
$objOU = GetObject($LDAP)
if VarTypeName($objOU)='Object'
? ucase(Left($Filter,1)) + substr($Filter,2) + "(s) in ($LDAP)"
$objOU.Filter = $aFilter
for each $item in $objOU
$Name = $item.Name
? " " + substr($Name,4)
$i = $i +1
next
?
$aFilter[0] = "organizationalUnit"
$objOU.Filter = $aFilter
for each $item in $objOU
$Name = $item.Name
$pos = instr($LDAP,"OU=")
$DN = Left($LDAP,$pos-1) + $Name + ", " + substr($LDAP, $pos)
$j = EnumOUs($DN, $Filter);
$i = $i + $j
next
else
"GetObject COM error: " + @error + " " + @serror
endif
$EnumOUs = $i
Endfunction
[ 13 June 2002, 19:38: Message edited by: Howard Bullock ]