tags:

views:

554

answers:

2

Hi,

is there a way to query LDAP with a syntax similar to the "IN" statement in SQL? I mean by providing a list of value instead of repeating the field name again and again.

Let me explain:)

I have a query similar to:

(&(name=joe)(name=bill)(name=mark)(name=john)(name=rob))

Is there a way to shrink this query to get something like this:

(name=joe,bill,mark,john,rob)

Thanks

+6  A: 

Unfortunatelly no. The ldapsearch filter has to conform to the RFC2254 standard.

But you can always write your own wrapper (for example shell script invoking ldapsearch) that will rewrite your list-like syntax into proper RFC2254 syntax :)

Swiety
A: 

Also, I'd guess you want that query to use | instead of &.

J. David Beutel