get active directory users whose FirstName in active directory is not empty or NULL

梦想的初衷 提交于 2019-12-11 17:59:34

问题


 Searcher.Filter = "(&(objectCategory=person)(objectClass=user)(!givenName=""))"

I'am using the above active directory search filter to try and get users whose FirstName in active directory is not empty or NULL but the filter still returns null entries.

What should I change in the filter to only retreive users with a first name that is not NULL or Empty


回答1:


Can you try :

 Searcher.Filter = "(&(objectCategory=user)(objectClass=user)(givenName=*))"

To build a filter you can use registered query in Active-Directory MMC :



来源:https://stackoverflow.com/questions/8051470/get-active-directory-users-whose-firstname-in-active-directory-is-not-empty-or-n

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!