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?
MacGyver80Senior Systems AdministratorAsked:
Who is Participating?
Colin McDonaldConnect With a Mentor Commented:
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.

All Courses

From novice to tech pro — start learning today.