6

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=''))
leeand00
  • 4,919

1 Answers1

7

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.

jscott
  • 24,754