Shine
Shine

Reputation: 83

LDAP query to get the list of users which are matching the group pattern

I am trying to query the groups from Ldap starting with groupname-* and all users part of these groups.

Group filter condition is: (CN=groupname-*).

User filter condition is: (memberof=cn=groupname*,OU=Application,OU=Groupings,DC=xx,DC=com))

This is returning all groups matching the pattern. However I'm not able to get the users details.Works only when I specify the complete group name in user filter. Is there any way to get all users matching the group pattern.

Upvotes: 0

Views: 1424

Answers (1)

mvreijn
mvreijn

Reputation: 2942

It appears you are querying AD. When searching for memberOf, only complete values are supported, not wildcards.

So your best bet is to query the groups and read their member attribute in order to get a list of user DNs.

Upvotes: 1

Related Questions