Active Directory DirectorySearcher Filter

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mohaaron@gmail.com

    Active Directory DirectorySearcher Filter

    Hello all,

    I'm having a problem with a query I've created to find users by first
    name, last name, and/or the combination. This worked until I found a
    user who has a space in their last name and the search doesn't find
    them. Can anyone tell me why the following LDAP query won't find a
    user with a space in their last name?

    string firstName = "MyName";
    string lastName = "Da Rosa";
    "(&(objectClass =User)(objectCa tegory=person)( !userAccountCon trol:
    1.2.840.113556. 1.4.803:=2)(giv enName=" + firstName + "*)(sn=" +
    lastName + "*))"
Working...