ldapsearch syntax part three


Looking for a given user, searching on 2 fields – first name and surname.



Here is an example of searching against 2 fields, effectively a logical AND.



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



[tags]ldapsearch syntax, openldap ldapsearch, LDAP Training School[/tags]


If you have found my website useful, please consider buying me a coffee below 😉

Leave a Reply

Your email address will not be published. Required fields are marked *