How to get the Owner of a Group from Active Directory

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hello Folks,
I am trying to get the owner of a group in active directory. We have a users group created in active directory with multiple users assigned owner/admin previliges. I need to retrieve the members of the group and need to display administrator/owner of the group and followed By the members. I am able to retrieve the members , but not able to get the owner. I tried to use the managedby property but it didnot provide the exact users with names. Please help me on this. PrincipalContext pc = new PrincipalContext(ContextType.Domain, "Domain")
GroupPrincipal group = GroupPrincipal.FindByIdentity(pc, groupName);
List<Principal> members = group.GetMembers().OrderBy(d => d.DisplayName).ToList<Principal>();

View the full article
 
Back
Top