Problem
Looking for a given user, searching on 2 fields – first name and surname.
Solution
Here is an example of searching against 2 fields, effectively a logical AND.
Example
Searching on two fields and returning those fields, plus email.
ldapsearch -x -v-D"cn=Manager,dc=demo,dc=net"-w secret
-b'dc=demo,dc=net' -s sub '(&(givenname=John)(sn=Doe))'
givenname sn mail
Reference
[tags]ldapsearch syntax, openldap ldapsearch, LDAP Training School[/tags]