views:

33

answers:

1

Hello all

I need to get some users from LDAP, only those that belong to groups whose names begin with a pattern, something like this

((&objectcategory=user)(memberof=cn=**groupNamePattern_***,OU=distribution,DC=xx,DC=com))

I think it needs to do some sort of sub-query, so that it first retrieves the list of groups that match the pattern, then the users of those groups.

How such query can be expressed?

A: 

Why not query for: (cn=**groupNamePattern_***)

with a base of OU=distribution,DC=xx,DC=com

and return the member list.

geoffc
azathoth
@azathoth: So in your query for the group, return the member attribute. That will return all groups that match the pattern, and their member list. So loop through the list of returned values.
geoffc
Can you provide a sample query, please? I'm new to LDAP
azathoth
geoffc
I have done some research, and found out that I can't use wildcards in LDAP filters for attributes containing LDAP distinguished names, as my requirement states (I need to get the users in a single query, no scripts involved). Thank you, anyway
azathoth