5

How does one query an ldap attribute for a blank value? The equivalent of str1==null in programming?

I tried the following but it didn't work:

(&(objectCategory=computer)(whenCreated>=20160101000000.0Z)(description=))
(&(objectCategory=computer)(whenCreated>=20160101000000.0Z)(description=''))
5

You have to negate matching the wildcard * (any value) :

(&(objectCategory=computer)(whenCreated>=20160101000000.0Z)(!description=*))

From Microsoft's LDAP Query Basics:

The ! operator in conjunction with the wildcard operator will look for objects where that attribute is not set to anything.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.