Active Directory DirectorySearcher Filter

Discussion in 'ASP .Net' started by mohaaron@gmail.com, May 22, 2008.

  1. Guest

    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 + "*))"
    , May 22, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jay
    Replies:
    1
    Views:
    19,256
  2. Roger Bavaud

    DirectorySearcher Filter Exchange Server

    Roger Bavaud, Nov 3, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    606
    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=
    Nov 5, 2004
  3. =?Utf-8?B?VGFzaA==?=

    active directory query using directorysearcher

    =?Utf-8?B?VGFzaA==?=, Jul 19, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    713
    =?Utf-8?B?RWx0b24gVw==?=
    Jul 19, 2005
  4. =?Utf-8?B?Unlv?=

    How to filter Active Directory using objectGUID ?

    =?Utf-8?B?Unlv?=, Oct 19, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    3,398
    =?Utf-8?B?Unlv?=
    Oct 19, 2005
  5. mike
    Replies:
    4
    Views:
    3,608
Loading...

Share This Page