Page 1 of 1 1
Topic Options
#197041 - 2009-12-09 12:49 PM Extract the Description from AD of whole OU
Shorty Offline
Just in Town

Registered: 2006-03-13
Posts: 2
Loc: Holland
Hi,

Is it possible to extract the Description from all users in AD that are in a specific OU.
I tried it with fnLDAPQuery(), but receive the following message
"ERROR: Error in expression: this type of array not supported in expressions.!"

I use the following code
 Code:
 $aAttributes = "Name", "description"  
 $sADsPath = "LDAP://OU=user OU,OU=location OU,DC=domain,DC=com"  
 $strFilter = "(&(objectClass=User)(Name=*))"  
  
 $aResults = fnLDAPQuery($aAttributes,$sADsPath,$strFilter,"Name")  
 @ERROR " | " @SERROR ?  
  
 For $c = 0 to Ubound($aResults) 
     For $r = 0 to Ubound($aResults,2) 
         $aResults[$c,$r] ? 
     Next 
     ? 
 Next

Am I doing something wrong? Can it be done with fnLDAPQuery() and how?


Edited by Mart (2009-12-09 01:11 PM)
Edit Reason: Please use code tags when posting code.

Top
#197047 - 2009-12-09 04:40 PM Re: Extract the Description from AD of whole OU [Re: Shorty]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4367
Loc: New Jersey
Change this line
 Code:
         $aResults[$c,$r] ? 
to
 Code:
         VarTypeName($aResults[$c,$r]) ? 
and see if that provides a clue to the error message! I'll bet that the array element itself contains an array.. you'll need to determine that and enumerate that list. It's in the LDAPQuery UDF examples.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#197064 - 2009-12-10 01:13 PM Re: Extract the Description from AD of whole OU [Re: Glenn Barnas]
Shorty Offline
Just in Town

Registered: 2006-03-13
Posts: 2
Loc: Holland
Great problem solved.
Thanks

Top
Page 1 of 1 1


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

Who's Online
0 registered and 200 anonymous users online.
Newest Members
Kelly001, MichaelK72, Janneman, standardbruker, maikoenig2001
17773 Registered Users

Generated in 0.032 seconds in which 0.011 seconds were spent on a total of 13 queries. Zlib compression enabled.

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