Problem
You want to match more than one field, in your LDAP search.
Solution
To match more than one field we use the ampersand – “&” with ldapsearch.
Example
This is how to perform a logical AND LDAP search.
ldapsearch -x -v-D"cn=Manager,dc=demo,dc=net"-w secret \
-b"dc=demo,dc=net" "(&(givenname=John)(sn=Smith))"
Reference
Technorati Tags: ldapsearch syntax, openldap ldapsearch, LDAP Training School