How do I export distribution groups and Mail contact to a csv file in Exchange

Posted on 2014-11-07
Last Modified: 2014-11-12
Hi Guys,

I would like a exchange shell script to help me understand which contacts belong to which distribution list.

Question by:chrislindsay
LVL 19

Expert Comment

by:Adam Farage
ID: 40428108
Get-DistributionGroupMember -Identity <> | Select Identity, PrimarySmtpAddress | Export-CSV C:\DistributionGroup.csv

Author Comment

ID: 40428148
sorry for my ignorance but what do i ender in the <> part of the script as all my contacts have different email domains?  Thanks

Expert Comment

ID: 40428516
You could do the following:

Get-DistributionGroup “your_distro_name” | Get-DistributionGroupMember | Select Name,RecipientType | export-csv c:\distro_contacts.csv

This will list the members of your desired distribution list and provide their recipient type. Simply filter out every RecipientType except MailContact.
Do email signature updates give you a headache?

Constantly trying to correctly format email signatures? Spending all of your time at every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today!


Author Comment

ID: 40428678
Hi I would like all the distribution groups returning.....
LVL 31

Accepted Solution

Gareth Gudger earned 500 total points
ID: 40430818
Check out this blog post here.

foreach ($group in Get-DistributionGroup) { get-distributiongroupmember $group | ft alias, @{label=’Group′;expression={$}}} | export-csv c:\distro_contacts.csv

Author Closing Comment

ID: 40436908
Worked well thanks
LVL 31

Expert Comment

by:Gareth Gudger
ID: 40438092
Great stuff.

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video we show how to create a Contact in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Contact ta…
This video discusses moving either the default database or any database to a new volume.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now