Recursive Group parsing for members

Posted on 2006-04-18
Last Modified: 2012-06-27
I have a list of ACL dumps from a folder and I know what groups have access to specific directories.
I would like to find an example of a script (wmi or VBScript) which would give me a list of all users in those groups.
This sounds simple, if not the fact that each Domain group could contain other groups and I need to expand those to get Every User, having access to a particular directory, irregardless if it's a direct or nested membership through other groups. And there might be groups in groups in groups etc... theoretically endless, if there is a problem and two global groups are in a loop.

Does anyone have any working examples?
Or a utility that would expand the group membership for a particular group through all the nested groups into a simple text file would do good as well.
Question by:sstouk
    LVL 11

    Expert Comment

    LVL 6

    Author Comment

    From what I can see this is an example of the script which gives the Group membership where user belongs in and I need the nested users, belonging to one group - quite the opposite.
    I will try to see if I can customize it, but the direct example would be better.
    I am looking for:
    "List all users in a group and all nested groups"
    LVL 11

    Accepted Solution

    Then it will be something like this:

    On Error Resume Next
    Set objGroup = GetObject _
    arrMemberOf = objGroup.GetEx("member")
    WScript.Echo "Members:"
    For Each strMember in arrMemberOf
        WScript.echo strMember

    In the above you can have something like if objectclass.strmember='group' then do the recursion
    LVL 6

    Author Comment

    Thank You.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Many of us need to configure DHCP server(s) in their environment. We can do that simply via DHCP console on server or using MMC snap-in on each computer with Administrative Tools installed in a network. But what if we have to configure many DHCP ser…
    Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now