PowerShell script to fetch group membership of a user in AD

Manish Kumar
Manish Kumar used Ask the Experts™
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
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Technical Consultant
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 :)


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

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

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

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