PrincipalContext ctx = new PrincipalContext(ContextType.Domain); // create ctx using (ctx) { Principal p1 = Principal.FindByIdentity(ctx, child.Name); // get Principal for the current user using (p1) { var groups = p1.GetGroups(); using (groups) { foreach (Principal group in groups) // cycle through all the groups for this user { // get group list } // end using (groups) } // end using (p)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)