#86037 - 2002-06-13 07:37 PM
Re: $object.Filter Issue
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
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 ]
|
Top
|
|
|
|
#86039 - 2002-06-13 08:28 PM
Re: $object.Filter Issue
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
Do you mean the Grand "OLE" Opry? lol
Brian
|
Top
|
|
|
|
#86040 - 2002-06-13 09:31 PM
Re: $object.Filter Issue
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Ahhh, mildly cheeky for guy with only 500+ posts, eh ? And you said you were looking for a job around here, eh ? Got to get alot more cheeky than that if you want to work around here
|
Top
|
|
|
|
#86042 - 2002-06-13 11:06 PM
Re: $object.Filter Issue
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
That would be fine, Shawn. I don't know if Henri is around or not. Amazing I should be helping moderate a forum with a topic that makes me still feel like a complete "newbie"! Some days I look at this stuff and think it's pure magic. Other days, I become a magician and still wonder how it works and if I'm doing it right.
Brian
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 229 anonymous users online.
|
|
|