• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 206
  • 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?
0
MacGyver80
Asked:
MacGyver80
  • 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

https://gallery.technet.microsoft.com/Export-all-distribution-707c27eb#content
0
 
MacGyver80Senior Systems AdministratorAuthor Commented:
Exactly what I needed.  Worked flawlessly.

Thank you
0
 
Colin McDonaldCommented:
No probs,  used it a few times now...  Happy to help
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

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