Solved

List Users in an ADS Group

Posted on 2004-08-19
7
151 Views
Last Modified: 2010-04-13
Hi,

I am wanting to list all the users in an ADS group, but there are groups within this group, and possibly groups with in these child groups.  (I didn't set this up!!)

I would like the output to show all the users in the parent group, all child groups with all their members and any groups there, and so on.  I need this to get a list of all users which have permissions on a set of resources.  I realise I can do this manually, but it's a total mess and will take ages, so an automated way would be very useful.

If this question doesn't make sense, please let me know and I'll do my best to clarify!

Thanks for your help!
0
Comment
Question by:Dak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 
LVL 17

Expert Comment

by:Eagle6990
ID: 11842558
I don't know for sure if this will just list another group or actually break out everyone but try this command just for fun.

net group "Groupname" /domain

It should list all of the members of the group, but I don't know what a nested group will do.
0
 

Author Comment

by:Dak
ID: 11842906
Hi there!

Thanks for the suggestion, but this only displays the users in the group and not any groups in there, or any sub groups.

Any other thoughts?

Cheers.
0
 

Author Comment

by:Dak
ID: 12339110
Hi there,

I am very interested in finding a resolution to this question, but there does not seem to be any forthcoming answers.  I have responded to all comments added to the thread, and have in no way abondoned it.

If you feel the need to close the call, then do so but I would prefer an answer to the query before you do so.

Thanks.
0
 
LVL 17

Expert Comment

by:Jared Luker
ID: 12956255
This worked out pretty good for me... you'll have to change the strGroupDN to match your domain, but it seems to work pretty well.

'Listing 1: Enum_groups.vbs

option explicit

Dim objArgs, strGroupDN
set objArgs = WScript.Arguments
if objArgs.Count <> 1 then
   Dim objRootDSE
   set objRootDSE = GetObject("LDAP://RootDSE")
   strGroupDN = "cn=Domain Admins,cn=users," & objRootDSE.Get("defaultNamingContext")
else
   strGroupDN = objArgs.Item(0)
end if

Dim dicSeenGroupMember
set dicSeenGroupMember = CreateObject("Scripting.Dictionary")
Wscript.Echo "Members of " & strGroupDN & ":"
DisplayMembers "LDAP://" & strGroupDN, " ", dicSeenGroupMember

Function DisplayMembers (strGroupADsPath, strSpaces, dicSeenGroupMember)

   Dim objGroup, objMember
   set objGroup = GetObject(strGroupADsPath)
   for each objMember In objGroup.Members

      Wscript.Echo strSpaces & objMember.Get("distinguishedname")
      if objMember.Class = "group" then

         if dicSeenGroupMember.Exists(objMember.ADsPath) then
            Wscript.Echo strSpaces & "   ^ already seen group member " & _
                                     "(stopping to avoid loop)"
         else
            dicSeenGroupMember.Add objMember.ADsPath, 1
            DisplayMembers objMember.ADsPath, strSpaces & "  ", _
                           dicSeenGroupMember
         end if

      end if

   next
End Function

0
 
LVL 17

Accepted Solution

by:
Jared Luker earned 250 total points
ID: 14135047
I think that I should get the points.  I provided a script that I think does what the author was looking for
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

624 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