Solved

Exchange 2010 SP3 | Powershell - Export all DLs to CSV and Import Commands

Posted on 2014-12-10
3
187 Views
Last Modified: 2014-12-12
I know the command to export a specified DL to csv but is there a command to export all DLs to CSV?
0
Comment
Question by:MacGyver80
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
Colin McDonald earned 500 total points
ID: 40492095
I use the following powershell script to export distribution lists and its members to a CSV file

$dist = ForEach ($group in (Get-DistributionGroup -Filter {name -like "*"}))
   {  Get-DistributionGroupMember $group | Select @{Label="Group";Expression={$Group.Name}},@{Label="User";Expression={$_.Name}},SamAccountName
   }
$dist | Sort Group,User | Export-CSV c:\scripts\file.csv -NoTypeInformation


Hope that helps

Not used this one before but it looks pretty useful

https://gallery.technet.microsoft.com/Export-all-distribution-707c27eb#content
0
 
LVL 4

Author Closing Comment

by:MacGyver80
ID: 40493833
Exactly what I needed.  Worked flawlessly.

Thank you
0
 
LVL 1

Expert Comment

by:Colin McDonald
ID: 40495675
No probs,  used it a few times now...  Happy to help
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
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 a Shared Mailbox 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 >> Sha…
In this video we show how to create a mailbox database 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 Servers >> Data…

831 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