Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ennumerating group members 1

Status
Not open for further replies.

MasterRacker

New member
Oct 13, 1999
3,343
0
0
US
I'm suffering temporary braindeath here. Which of the admin tools, server res kit tools or command line tools can give me a simple listing of all my AD security groups and the members of each group?

This combination of CLIs gave me login scripts for each user:

[small][tt]dsquery user -name * -limit 300 | dsget user -ln -fn -upn -samid -loscr >> C:\LoginScripts.txt[/tt][/small]

and this is close for groups:

[small][tt]dsquery user -name * -limit 300 | dsget user -memberof -expand >> c:\GroupMembership.txt[/tt][/small]

however "-memberof" doesn't seem to work with other switches, so I get more than I need for group memberships and no names. I need a better way to do this


_____
Jeff
[small][purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me[/small]
 
acl03,
The script in that thread gave me a good starting point. I was able to add code to write to a file and read groups from a file. A little rough, but it does what I need. Thanks.

_____
Jeff
[small][purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me[/small]
 
Hey Jeff,

would you be willing to post your final version of the script. I'm looking to do the same and don't want to reinvent the wheel.

Thanks,
Nate
 
Nate,

Have a look here:
thread931-1451502

It was a different post, but the last script here does what was needed here.

hth,

Will
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top