问题
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