Page 2 of 2 <12
Topic Options
#86037 - 2002-06-13 07:37 PM Re: $object.Filter Issue
Howard Bullock Offline
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. [Wink]

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. [Big Grin]
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 ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#86038 - 2002-06-13 08:08 PM Re: $object.Filter Issue
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Thanks How (may I call you How?).

Yeah, you know I love anything that contains the string "OLE" ... but reading a Perl script that contains OLE is a bit like going to the Opera - you don't know what they're saying, but since its Opera, it must be good (heheh) ...

-Shawn

Top
#86039 - 2002-06-13 08:28 PM Re: $object.Filter Issue
BrianTX Offline
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 Offline
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 [Wink]
Top
#86041 - 2002-06-13 09:39 PM Re: $object.Filter Issue
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Actually, seriously, Brian - I'd like to move forward with getting you co-moderating COM - if your keen on doing that - I wonder if Henri has left on vacation yet or not ? Didn't Jack say he was heading off for a week or three ?
Top
#86042 - 2002-06-13 11:06 PM Re: $object.Filter Issue
BrianTX Offline
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. [Smile]

Brian

Top
Page 2 of 2 <12


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2141 anonymous users online.
Newest Members
BeeEm, min_seow, Audio, Hoschi, Comet
17882 Registered Users

Generated in 0.038 seconds in which 0.021 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org