Ldap filter for attribute that may not exist

Johnny_D picture Johnny_D · Mar 30, 2012 · Viewed 35.5k times · Source

I have a problem with adding filter for attribute, which exist not in all members of organization unit. I set filter like this^ (status=Active) But this property doesn't exist in half of members and server returns "unwilling to execute 53 error". I wonder how should I rewrite this filter query to make it work only for objects with this attribute? Thanks

Answer

Terry Gardner picture Terry Gardner · Mar 30, 2012
  • To return entries that contain a populated status attribute, use a present filter, for example, (status=*).
  • To return entries that do not contain a status attribute, negate the present filter: (!(status=*)).
  • If the server is unwilling to execute, check that the status attribute is indexed for equality and presence. If do not have access to this information, check with the LDAP administrators in the appropriate organization.

see also