• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 209
  • Last Modified:

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

I know the command to export a specified DL to csv but is there a command to export all DLs to CSV?
  • 2
1 Solution
Colin McDonaldCommented:
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

MacGyver80Senior Systems AdministratorAuthor Commented:
Exactly what I needed.  Worked flawlessly.

Thank you
Colin McDonaldCommented:
No probs,  used it a few times now...  Happy to help
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

We Need Your Input!

WatchGuard is currently running a beta program for our new macOS Host Sensor for our Threat Detection and Response service. We're looking for more macOS users to help provide insight and feedback to help us make the product even better. Please sign up for our beta program today!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now