Due to a *quirk* in our domain forest, I need to change how I'm getting a logged on user's group membership. When a user authenticates into this application I need to see if they belong to one of 4 groups. In our test environment I was using:
ArrayList groups = new ArrayList();
foreach (System.Security.Principal.IdentityReference group in
System.Web.HttpContext.Current.Request.LogonUserIdentity.Groups)
{
groups.Add(group.Translate(typeof(System.Security.Principal.NTAccount)).ToString());
}
return groups;
Which works perfectly. However I need to modify my approach to query a specific A/D server, and have not been able to figure out how to do this. Does anyone know how I can take the functionality in the code above, and reference a specific domain controller (i.e. LDAP://{domaincontrollername/DC={domain},DC={com} ... etc) to pull a users group membership?
Thanks!