Link to home
Start Free TrialLog in
Avatar of dbrueckner
dbrueckner

asked on

Export Distribution Groups and members to csv file

Hi.  I'd like to export all of our universal distribution groups and corresponding members to a csv file. So one big output for everything to a single file.  Is there a command that can do this?

My active directory is on Win 2003 R2.

Any help would be appreciated - thanks!  
Avatar of Will Szymkowski
Will Szymkowski
Flag of Canada image

You can use the following PowerShell command...
Get-DistributionGroupMember -identity "distribution group name" | Export-Csv C:\MyFile.Csv

Also refer to this link..
http://www.ucblogs.net/blogs/exchange/archive/2008/07/03/Exporting-distribution-list-membership-to-Excel.aspx
Avatar of dbrueckner
dbrueckner

ASKER

do you know if there is a way or wild card so that a single command will run through all the distribution groups at once to a single file?  that was what i was looking for.
ASKER CERTIFIED SOLUTION
Avatar of avalenzuela
avalenzuela
Flag of Mexico image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
See this question I helped with last year

https://www.experts-exchange.com/questions/24328572/Export-only-Distribution-List-Members-from-Active-Directory-to-Excel.html

I used adfind in my example; the vbscript ended up being picked....both should work.  I didn't test Tony's script but he is a top guy and is scripts are solid.

Thanks

Mike