List members of a Group

You can retrieve a list of users from a Security or Distribution Group in domain by using DSget tool - a new tool introduced in Windows 2003. This tool and other related tools ships with Windows 2003 CD.


Let's say you need to gather a list of users (+nested groups) from a domain group. This is bit easy. You can use the following command to accomplish the goal:

dsget group "DN_of_group" -members -expand > userlist.txt

The output will be saved in userlist.txt

This is the sample output saved in userlist.txt

"CN=Shan Dallis,OU=Users,DC=test,DC=local"
"CN=Tapihe C Mdwa,OU=Users,DC=test,DC=local"

and so on...

Comments

# re: List members of a Group

Wednesday, May 16, 2007 1:50 AM by Raj

Hi,

Thanks for the good information.

Thanks

Raj.

# re: List members of a Group

Thursday, September 06, 2007 2:18 AM by Prasi

Just type

c:\ net group <group name> /domain > abc.txt

# re: List members of a Group

Friday, March 07, 2008 4:49 AM by Carl

thats very good, but how do I just have the list of usernames in the txt file rather than all that other crap with it. :)

Thanks in advance

# re: List members of a Group

Wednesday, October 08, 2008 10:58 AM by Wally

you could get just teh user names with a simple vb script ..

;....

set args = Wscript.Arguments

set grp = GetObject("WinNT://DomainName/" + args(0), group)

for each usr in grp.members

wscript.echo usr.name

next

;....

Then run from the command line

  cscript scriptname.vbs GroupName

you can modify the vb, to include the info you want, add delimiters, etc. eg. wscript.echo usr.name & " " & usr.fullname & " " & usr.description

# re: List members of a Group

Sunday, December 14, 2008 11:23 PM by Ausadmin

The dsget command worked but returned DNs which are a bit of a pain to email and working out the dsget piping was just too hard.  This script from Richard Mueller worked a treat to get the logon names:

www.rlmueller.net/List%20Members%20of%20a%20Group.htm

Leave a Comment

(required) 
(required) 
(optional)
(required)