![]() |
Seeing the members of an AD group |
Post Reply
|
| Author | ||||||||
Karlchen
Senior Member
Joined: 18 June 2005 Location: Germany Online Status: Offline Posts: 5121 |
Post Options
Quote Reply
Topic: Seeing the members of an AD groupPosted: 06 July 2007 at 5:19am |
|||||||
|
Hi, Mark.
This might, however, depend on special restrictions imposed by the AD administrators as well.
ShareEnum, however, will walk through your network and ask any machine it detects unless you restrict it to a particular IP-range or sub-domain or workgroup. Kind regards, Karl Edited by Karlchen - 06 July 2007 at 5:22am |
||||||||
![]() |
||||||||
robbinma
Senior Member
Joined: 06 March 2006 Location: United Kingdom Online Status: Offline Posts: 137 |
Post Options
Quote Reply
Posted: 05 July 2007 at 12:30pm |
|||||||
|
Hi Karlchen,
Thanks for putting the time into this.
It is still valid even though it has been a month since the original posting.
I haven't had time to investigate this beyond my initial attempts.
I will try following up your ideas next week when my workload has gone down a bit.
I have to be slightly careful as I'm not an administrator and we have quite a lot of servers so I don't want to do anything that goes around querying every machine as we have quite a lot of servers.
best regards,
Mark
|
||||||||
![]() |
||||||||
Karlchen
Senior Member
Joined: 18 June 2005 Location: Germany Online Status: Offline Posts: 5121 |
Post Options
Quote Reply
Posted: 05 July 2007 at 2:36am |
|||||||
|
Hello, Mark.
As there was a lengthy excursion on "adfind" - my fault, I know - I thought coming back to your initial post and the requests you had might be a good idea:
(1)
Suggested solution: cf. the sample script here which uses JoeWare adfind. (2) If you just wish to check if user "domain\username" is member of the AD group "Domain Admins" e.g., JoeWare MemberOf is highly recommended.
(3)
If for the moment the request can be restricted to "access to a network share", you might consider using AccessChk. AccessChk will, however, not be able to tell you if a user is allowed to use a particular (network) printer e.g. Sysinternals ShareEnum might prove very helpful, too. It will list network disk shares as well as network printers e.g. As the thread was started 1 month ago, I hope that the information given will still be helpful, despite the long delay. Kind regards, Karl Edited by Karlchen - 05 July 2007 at 2:44am |
||||||||
![]() |
||||||||
Karlchen
Senior Member
Joined: 18 June 2005 Location: Germany Online Status: Offline Posts: 5121 |
Post Options
Quote Reply
Posted: 04 July 2007 at 2:04pm |
|||||||
|
Good news: multiple adfind passes will list all group members
It will work like this:
And here is the extended adgroupmembers.cmd script:
Call it like this:
But before you do so, you will at minimum have to adapt this line to match your AD:
Known restriction: If a group member is not a person, but another group, the members of this group will not be determined and listed, i.e. no recursion is done to resolve nested groups.
It should be pretty easy to modify this sample in such a way that it will + interactively ask for the AD group, + interactively ask for a loginname, + at the end tell you if "loginname" is a member of the AD group. (Rather use MemberOf for this purpose.) HTH, Karl Edited by Karlchen - 05 July 2007 at 2:41am |
||||||||
![]() |
||||||||
Karlchen
Senior Member
Joined: 18 June 2005 Location: Germany Online Status: Offline Posts: 5121 |
Post Options
Quote Reply
Posted: 03 July 2007 at 12:05pm |
|||||||
|
Bad news (sort of bad anyhow):
The member list generated by the command
Reason: adfind launches an LDAP query. Such a query will only return those group members who are listed inside the group properties as "memberOf". (secondary group membership) All those group members, who are assigned this group as their primary group, will not have a "memberOf" entry to query in the group properties. So at minimum a second adfind command will be required to locate all primary members of the user group whose members we would like to collect. As these primary members need not belong to the same OU (Organizational Unit), things are even more complicated than just a second adfind command. Cf. here, please. Summary so far Looks as if neither LG, nor adfind can be used in order to achieve our goal. [Added 04-JUL-2007] At least not in a single pass. Details: see next post.
[/Added] Karl Edited by Karlchen - 04 July 2007 at 1:43pm |
||||||||
![]() |
||||||||
Karlchen
Senior Member
Joined: 18 June 2005 Location: Germany Online Status: Offline Posts: 5121 |
Post Options
Quote Reply
Posted: 02 July 2007 at 2:53pm |
|||||||
|
Good evening, Mark.
So far I have not managed to persuade LG to show me a complete list of all our domain user groups including all members, either. Here is a somewhat rough and still unfinished adfind solution. (adfind by Joeware):
Anyway: here is the first script draft which uses adfind to get all user groups existing in my.domain.net (dc=my,dc=domain,dc=net) and which will output each user group and the members of the group 1 per line:
If someone knows a more effective approach, using "adfind" or "dsquery", kindly share your knowledge with us.
Yet, you can limit the query scope by adding the appropriate "OU=<organizational unit>" to the "adfind" command, i.e. by running "adfind" like this:
The output of the unrestricted adfind command my help find out which "OU=<unit1>,OU=<unit2>,.." need to be prefixed in order to reduce the scopy to the 1 user group you wish to query. Example: This command will list the members of 1 domain user group for me:
Cannot judge if this approach will do for you as well. Kind regards, Karl Edited by Karlchen - 02 July 2007 at 3:25pm |
||||||||
![]() |
||||||||
robbinma
Senior Member
Joined: 06 March 2006 Location: United Kingdom Online Status: Offline Posts: 137 |
Post Options
Quote Reply
Posted: 01 July 2007 at 2:13pm |
|||||||
|
Thanks Karl. I have tried out the LG tool and it looks promising. I have a slightly complicated situation because I have groups contain members of other domains and it can only tell me the name of the groups and their associated domains. My other problem is that I can't find out which domain server hosts one of my groups. When I use LG it tries my local server but it says that it doesn't host the group. Any ideas on how to find the server hosting the group? Thanks again, Mark |
||||||||
![]() |
||||||||
Karlchen
Senior Member
Joined: 18 June 2005 Location: Germany Online Status: Offline Posts: 5121 |
Post Options
Quote Reply
Posted: 16 June 2007 at 4:52am |
|||||||
|
Hello, Mark.
No warranty given that this utility will be appropriate (have not tried it myself so far), yet it may be worth a try: LG by joe@joeware.net. Seems as if viewing does not require admin privileges. Usage: cf. here, please. Hm, maybe this one may be of use as well: MemberOf by joe@joeware.net. Usage: cf. here, please. Karl Edited by Karlchen - 16 June 2007 at 4:59am |
||||||||
![]() |
||||||||
robbinma
Senior Member
Joined: 06 March 2006 Location: United Kingdom Online Status: Offline Posts: 137 |
Post Options
Quote Reply
Posted: 06 June 2007 at 5:48am |
|||||||
|
It would be useful to be able to see who the members of a group are. As a developer I don't get granted access to AD related tools but I'm still encounter problems where a user isn't in a group. This can take some time to debug as I need to get an administrator to check the groups....
It would be great to have a tool that could accept a group name e.g. DOMAIN\SH_TOOL and list the members.
I know that there are WMI type scripts that are available (from the MS Scripting guys) but these need extra information e.g. DC that I don't have and don't know how to figure out.
Ideally the tool would be easy to use so I can give it to the support staff so they can check if a user has access to a particular resource e.g. a network share...
|
||||||||
![]() |
||||||||
Post Reply
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |