1
votes

What is the search filter to list users belong to specific group like "engineering" in a ldap server which don't have backlink enabled.

For example, if backlink enabled i can use following filter,

(&(objectClass=person)(memberOf=cn=engineering,ou=Groups,o=company,o=com))

Wanted to know corresponding search query without using memberOf attribute.

Thanks DarRay

2

2 Answers

1
votes

Try your filter as:

(&(objectClass=group)(cn=engineering)) 

using a base of

ou=Groups,o=company,o=com

and a scope of subtree Returning attribute "member"

Or even more efficient:

(objectClass=group)

With a base of

cn=engineering,ou=Groups,o=company,o=com

and a scope of base Returning attribute "member"

-jim

0
votes

The main question is: How are the users linked to groups?

One way is by specifying the users as attributes in the group. That can be done either via the uniqueMember- or the memberUid-Attribute. To find the users of a certain group you will have to use two queries. One query will retrieve the DNs or UIDs of the users of a group by fetching the uniqueMember or memberUid attribute of the group in question depending on your setup. Then you can retrieve the users by either using (&(objectclass=person)(uid=<uid>)) or (&(objectclass=person)(dn=<dn>)).

The other way is by storing the grous as attributes in the user, which you described above.

Hope that helps.