Is there a Ldap filter for 'contains' or 'in'?

Viewed 12639

I need a Ldap query to return multiple users, and so I need it to go through a list of userIDs and search the directory.

Essentially, what I want to do is

(|(cn=val1)(cn=val2)(cn=val3).....)

I would use just the OR filter for a few values but I need to get upto 100 values. Is there a more efficient way of doing this? Probably a 'contains' or 'in' filter that lets me pass a list of values to check against?

3 Answers

Create a group, cn=RequiredUsers,OU=xxx, to contain the users and then you can perform the query like this:

(&(objectCategory=user)(memberOf=cn=RequiredUsers,OU=xxx))

Pick a good name for the group.

Related