locked
How to get the Owner of a Group from Active Directory RRS feed

  • Question

  • 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>();

    Monday, May 13, 2013 10:31 PM

All replies