Reputation: 387
In AD, I have the following User DNs:
CN=Some Guy,OU=Users,OU=Ohio,DC=company,DC=net
CN=Some Lady,OU=Users,OU=Jamaica,DC=company,DC=net
How can I do a query in LDAP that can retrieve both users, using the DN and wildcards?
I been trying the following string:
(&(dn=*Users*))
That gives me nothing. I try extensible search:
(&(dn:ou:=Users))
But that returns:
OU=Users,OU=Ohio,DC=company,DC=net
OU=Users,OU=Jamaica,DC=company,DC=net
I have several locations I need to search and I want to find what each location has under their Users OU.
Upvotes: 0
Views: 41
Reputation: 1815
The extensible search is not the correct one.
Use instead :
(&(objectClass=user)(ou:dn:=Users))
It should select every entry with objectClass=user
and which the dn
contains ou=Users
Upvotes: 1