开发者

DirectorySearcher null comparison in filters

I am trying to find LDAP objects which don't 开发者_高级运维have any value in their "manager" property. What should be the filter string? I am trying with this to no avail:

"(&(objectClass=user)(objectCategory=person)(manager=NULL))"


Try this:

(&(objectClass=user)(objectCategory=person)(!(manager=*)))

! is the "not" operator and * is the LDAP wildcard so the above will do a search for any entry that doesn't have a value set for the manager-attribute.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜