Active Directory DirectorySearcher Filter

M

mohaaron

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)(objectCategory=person)(!userAccountControl:
1.2.840.113556.1.4.803:=2)(givenName=" + firstName + "*)(sn=" +
lastName + "*))"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top