How can I formulate an ldap request looking for the absence of an attribute

I want to request my directory for all User objects that do not contain a value for this attribute ... I kind of cracked it, looking for things without a specific value (the potentially assigned values ​​are small, so this basically worked), but I would really like to know is there a way to actually request the absence of an attribute ... sort of like a null relational database.

Here is the query that I ended up using:

(&(objectClass=User)(!extensionAttribute1=A))

Any ideas on how to write an LDAP query to search for objects where the attribute is not defined? Is it possible?

+3
source share
2 answers

In this case, we need a few more partners:

(&(objectClass=User)(!(extensionAttribute1=*)))

- , ( )

(&(objectClass=User)(extensionAttribute1=*))

+5

(&! ( = User) (extensionAttribute1 = *))

+2

Source: https://habr.com/ru/post/1712727/


All Articles