LDAP filter on DistinguishedName - wildcards don't work

Discussion in 'Scripting' started by ASGMikeG, Oct 30, 2006.

  1. ASGMikeG

    ASGMikeG Guest

    Hi,
    I'm trying to select only AD users whose distinguishedName contaings the
    word 'General' i.e. *General*.

    Sample DN:
    CN=Michael Green,OU=General,OU=SYDNEY,OU=ASGGroup
    Users,DC=asggroup,DC=com,DC=au

    I have the following LDAP based User filter working :
    (&(objectCategory=Person)(objectClass=user)(sn=*)(GivenName=*)(mail=*)(
    !(userAccountControl:1.2.840.113556.1.4.803:=2)))

    However when I add:
    (distinguishedName=*General*)
    to this the filter returns nothing.

    Can anyone offer some guidance ?


    Regards
    Michael
     
    ASGMikeG, Oct 30, 2006
    #1
    1. Advertisements

  2. Sorry, wild cards are not allowed in DN attributes like distinguishedName,
    member, or memberOf. You must specify the full Distinguished Name in the
    filter.

    The only solution I can think of is to retrieve all users meeting the other
    criteria, then when you enumerate the collection or recordset, parse the
    Distinguished Name. Also, if you only want to consider objects in
    ou=General, make that ou the base of your search.
     
    Richard Mueller, Oct 31, 2006
    #2
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.