PrincipalContext ctx = new PrincipalContext(ContextType.ApplicationDirectory, "domain.com", "ou=*Garden City Users, o=microsoft,c=us", ContextOptions.SecureSocketLayer | ContextOptions.SimpleBind, "CN=ppatel, OU=*Garden City Users, O=Microsoft, C=US ", "password"); UserPrincipal up = UserPrincipal.FindByIdentity(ctx, IdentityType.Name,"ppatel"); if (up != null) { PrincipalSearchResult<Principal> Results = up.GetAuthorizationGroups(); foreach (Principal Result in Results) { Response.Write(Result.Name); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)