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...

Published Sun, Jan 28 2007 21:57 by Nirmal
Filed under:

Comments

# re: List members of a Group

Hi,

Thanks for the good information.

Thanks

Raj.

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

# re: List members of a Group

Just type

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

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

# re: List members of a Group

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

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

# re: List members of a Group

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

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

# re: List members of a Group

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

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

# re: List members of a Group

The "net group abc >C:\report.txt" worked great - but what I really need is the list of members in each group and what access level they have.  Any ideas on what to query for that?

Thanks much!

Wednesday, November 03, 2010 1:01 PM by Jeanne

# re: List members of a Group

galera eu gostaria de saber, se existe a opção de relacionar todos os grupos de um AD juntos com os membros que esses grupos possuem. valeuuu

Friday, January 07, 2011 12:00 PM by junior

# re: List members of a Group

Wallys script was gr8.... small simple and simply great! Thanks...

Tuesday, January 25, 2011 9:38 AM by Ali

# MS AD Exchange

Hi,

Please send profile of a candidate who is expert in MS AD Exchange from India only. Urgent requirement.

Veeshal

bsnnnn@yahoo.com

Tuesday, May 03, 2011 7:33 AM by Veeshal

# MS AD Exchange

HI,

There is urgent need of MS AD Exchange expert

send profile to bsnnnn@yahoo.com

Veeshal

Tuesday, May 03, 2011 7:35 AM by Veeshal

# re: List members of a Group

Thanks for the info... worked great..

Friday, December 23, 2011 4:58 PM by Prabu

# re: List members of a Group

string Department = "Billing";

DirectorySearcher LdapSearcher = new DirectorySearcher();

LdapSearcher.PropertiesToLoad.Add("displayName");

LdapSearcher.PropertiesToLoad.Add("cn");

LdapSearcher.PropertiesToLoad.Add("department");

LdapSearcher.PropertiesToLoad.Add("title");

LdapSearcher.PropertiesToLoad.Add("memberOf");

LdapSearcher.Filter = string.Format("(&(objectClass=user)(department={0}))", Department);

SearchResultCollection src = LdapSearcher.FindAll();

Thursday, February 02, 2012 7:01 AM by Lepide

# re: List members of a Group

Best Group Members List. Thank you for help.

Friday, April 20, 2012 11:25 AM by Norbert

# re: List members of a Group

BRILLIANT!  Thank you so much!

Wednesday, February 13, 2013 3:41 PM by Amy

# re: List members of a Group

Guys,

There are other ways to check this:

Please check out www.Dynamic-SpotAction.com

Thanks!

Nirmal

Wednesday, February 13, 2013 8:36 PM by Nirmal

Leave a Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above: