PowerShell script to fetch group membership of a user in AD

Manish Kumar
Manish Kumar used Ask the Experts™
on
Hi All,

I need to fetch group membership of one user in AD with  it's nested groups in different csv files.
I need a PowerShell script
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Technical Consultant
Commented:
I believe this is what you are looking for.. I have not used it personally, but as it is from MSDN it is thought to be good :)

http://blogs.msdn.com/b/adpowershell/archive/2009/09/05/token-bloat-troubleshooting-by-analyzing-group-nesting-in-ad.aspx

Check examples, as the results looks convincing.
Lionel MMSmall Business IT Consultant

Commented:
Did you check out some of the same question already answered on EE Here is one and here is another . The second one exports it to a CSV file.
Top Expert 2012

Commented:
DSquery to export member of Group

dsquery group -samid "Group Name" | dsget group -members | dsget user -display -email >C:\Groupname.csv

Open in new window

Qlemo"Batchelor", Developer and EE Topic Advisor
Top Expert 2015

Commented:
Are you able to post a simple example? I don't get what you mean with "in different csv files".

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial