Question : LDAP query to return list of sub-OUs?

Is it possible to use an LDAP query to return the list of 2nd level OU's within "Alphabet" below? If so, what would that query look like?

OU=Alphabet
   |- OU=A
         |- OU=Green
   |- OU=B
   |- OU=C
         |- OU=Yellow
   |- OU=D
OU=Numbers
   |- OU=Five

So I would just want a list of A, B, C, D returned by the query. The LDAP source is Active Directory 2003. I'm only after the names of the OU's, not anything inside of or below them.

Answer : LDAP query to return list of sub-OUs?


Afraid not, you can have a filter return OUs ("(objectClass=organizationalUnit)"), and OUs with specific names ("(&(objectClass=organizationalUnit)(name=A))"), but only second level, or a range of names is a bit beyond Ldap Filters.

It could be scripted pretty easily if you need to.

Chris
Random Solutions  
 
programming4us programming4us