Expand my Community achievements bar.

Need help with LDAP search filter

Avatar

Level 10

I tried the following filter to find members of a given group as:

(objectCategory=user)(memberOf=CN=QA Users,OU=Help Desk,DC=dpetri,DC=net)

which does not works.

Anybody can share their experience in searching LDAP for members of a group?

Thanks,

Nith

3 Replies

Avatar

Former Community Member

try to connect with an LDAPbrowser and there you will see the exact filter to use:

http://ldapadmin.sourceforge.net/

Avatar

Level 1

Hey,

the problem is "(objectcategory=user)", and a missing concatenation of filter criteria. You should try

(&(objectCategory=person)(memberOf=CN=QA Users,OU=Help Desk,DC=dpetri,DC=net))

In fact, an Active Directory User is searched exactly by this filter:

(&(objectClass=user)(objectCategory=person))

You can learn all about LDAP filters here:

http://www.selfadsi.org/ldap-filter.htm

Philipp

Avatar

Level 10

Thanks Philipp..

My search is working using the following search filter:

(&(objectClass=user)(SAMAccountName=myUserId)(memberOf=CN=All Head of Units,OU=Groups,DC=my,DC=domain,DC=com))

Thanks,

Nith