[problem]
Looking for a given user, searching on 2 fields – first name and surname.
[/problem]
[solution]
Here is an example of searching against 2 fields, effectively a logical AND.
[/solution]
[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
[/example]
[reference]
[tags]ldapsearch syntax, openldap ldapsearch, LDAP Training School[/tags]
[/reference]
If you have found my website useful, please consider buying me a coffee below 😉