Solved

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

Posted on 2014-11-07
7
95 Views
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.

Thanks
0
Comment
Question by:chrislindsay
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 19

Expert Comment

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

Author Comment

by:chrislindsay
ID: 40428148
sorry for my ignorance but what do i ender in the <dl_name@company.com> part of the script as all my contacts have different email domains?  Thanks
0
 
LVL 8

Expert Comment

by:tshearon
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.
0
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 

Author Comment

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

Accepted Solution

by:
Gareth Gudger earned 500 total points
ID: 40430818
Check out this blog post here.
http://oxfordsbsguy.com/2014/04/21/exchange-powershell-how-to-enumerate-distribution-lists-managers-and-members/

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

Author Closing Comment

by:chrislindsay
ID: 40436908
Worked well thanks
0
 
LVL 31

Expert Comment

by:Gareth Gudger
ID: 40438092
Great stuff.
0

Featured Post

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
In this video we show how to create an Address List 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 Organization >> Ad…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

752 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