PrincipalContextcontext=newPrincipalContext(ContextType.Domain,"ipofmachine","DC=xyz,DC=org","username","Password");UserPrincipaluserPrinciple=UserPrincipal.FindByIdentity(context,"User0");vargroups=userPrinciple.GetAuthorizationGroups();if(userPrinciple!=null){foreach(GroupPrincipalgpingroups){