ldapsearch logical NOT

[problem]

You want to perform an LDAP search, matching entries which do not match certain criteria.

[/problem]

[solution]

To perform a logical NOT we just use the exclamation mark ! – see example.

[/solution]

[example]

This is how to perform a logical OR LDAP search.


ldapsearch -x -v-D"cn=Manager,dc=demo,dc=net"-w secret
-b"dc=demo,dc=net" "(!(sn=Doe))"

[/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 😉

Leave a Reply

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