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: 4396
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
1 registered (Allen) and 466 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.051 seconds in which 0.024 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