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…
Hi,
Thanks for the good information.
Thanks
Raj.
Just type /domain > abc.txt
c:\ net 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
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
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:
http://www.rlmueller.net/List%20Members%20of%20a%20Group.htm
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!
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
Wallys script was gr8…. small simple and simply great! Thanks…
Nice one
http://www.windowstricks.in/2009/11/to-check-list-of-users-group-membership.html
http://www.windowstricks.in/2009/06/to-display-list-of-members-with-nested.html
http://www.windowstricks.in/2009/06/to-display-list-of-members-with-nested.html
Hi,
Please send profile of a candidate who is expert in MS AD Exchange from India only. Urgent requirement.
Veeshal
bsnnnn@yahoo.com
HI,
There is urgent need of MS AD Exchange expert
send profile to bsnnnn@yahoo.com
Veeshal
Thanks for the info… worked great..
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();
Best Group Members List. Thank you for help.
BRILLIANT! Thank you so much!
Guys,
There are other ways to check this:
Please check out http://www.Dynamic-SpotAction.com
Thanks!
Nirmal