views:

471

answers:

1

I'm trying to setup an ActiveDirectoryMembershipProvider to go against a Forest and I can't seem to get it working. One of our AD Admins suggested I refer to the global catalog but it seems that is not supported. Anyone know if you can and if so how do you configure the AD Membership Provider to go against a Forest?

Here are some of the permutations I've tried and the resultant errors.

<add name="ADConnectionString1"
    connectionString="LDAP://domain.org/DC=domain,DC=org:3268" />

"A referral was returned from the server"

<add name="ADConnectionString2"
    connectionString="LDAP://domain.org/DC=domain,DC=org:" />

A null reference exception.

<add name="ADConnectionString3"
    connectionString="LDAP://domain.org" />

A null reference exception

<add name="ADConnectionString4"
    connectionString="LDAP://domain.org:3268" />

"LDAP connections on the GC port are not supported against Active Directory."

<add name="ADConnectionString5"
    connectionString="LDAP://domain.org:3268/DC=domain,DC=org:3268" />

"LDAP connections on the GC port are not supported against Active Directory."

<add name="ADConnectionString6"
    connectionString="LDAP://domain.org:3268/DC=domain,DC=org" />

"LDAP connections on the GC port are not supported against Active Directory."

+1  A: 

I don't have access to test an ActiveDirectoryMembershipProvider at the moment but global catalog searches are usually performed using the GC:// moniker. E.g.

    using (DirectoryEntry searchRoot = new DirectoryEntry("GC://DC=yourdomain,DC=com"))
    using (DirectorySearcher ds = new DirectorySearcher(searchRoot))
    {
        ds.Filter = "(sAMAccountName=userID1)";
        ds.SearchScope = SearchScope.Subtree;
        using (SearchResultCollection src = ds.FindAll())
        {
            foreach (SearchResult sr in src)
            {
                uxFred.Content = sr.Path;
            }
        }
    }

My suggestion when working in ASP.NET is always to get your search filters, etc. working using LDP or just a plain console/winform/wpf app.

serialhobbyist
Couldn't get the membership provider to go against a GC but this worked for my purposes.
CptSkippy