Global Group Enum From Local ?

Discussion in 'ASP .Net Security' started by poi, Nov 17, 2003.

  1. poi

    poi Guest

    I have the code below that successfully gives all of the entries in a
    local group. But if an entry is a global group, then those users are
    not enumerated. How should I modify the code to dig into any global
    groups as well?

    Thanks.


    using System;
    using System.Collections;
    using System.Runtime.InteropServices;
    using System.DirectoryServices;
    using ActiveDs;

    .....

    public string GroupMembers( string userId )
    {
    string returnVal = "!Default";
    string locPath = "WinNT://" +
    System.Environment.GetEnvironmentVariable("COMPUTERNAME");

    DirectoryEntry localGroup;
    localGroup = new DirectoryEntry( locPath + "/LocalGroupTest,group" );

    object allMembers = localGroup.Invoke("Members");
    foreach (object groupMember in (IEnumerable)allMembers)
    {
    DirectoryEntry memberEntry = new DirectoryEntry(groupMember);
    returnVal += memberEntry.Name + " : ";
    }
    return returnVal;
    }




    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    poi, Nov 17, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. -

    enum within an enum

    -, Jun 12, 2005, in forum: Java
    Replies:
    6
    Views:
    538
  2. andres
    Replies:
    1
    Views:
    5,260
    dgoyani
    Oct 23, 2007
  3. Chad Dressler
    Replies:
    0
    Views:
    634
    Chad Dressler
    Dec 30, 2006
  4. localhost

    Determine Global Group vs User in Local?

    localhost, Dec 10, 2003, in forum: ASP .Net Security
    Replies:
    9
    Views:
    170
  5. soler
    Replies:
    0
    Views:
    222
    soler
    May 25, 2006
Loading...

Share This Page