Export all distribution lists from on-premise Exchange and Exchange Online

%3CLINGO-SUB%20id%3D%22lingo-sub-2390653%22%20slang%3D%22en-US%22%3EExport%20all%20distribution%20lists%20from%20on-premise%20Exchange%20and%20Exchange%20Online%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2390653%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%3C%2FP%3E%3CP%3EHope%20everyone%20is%20well.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20are%20in%20the%20midst%20of%20a%20migration%20and%20I%20need%20to%20export%20all%20distribution%20lists%20from%20our%20Exchange%20on-premise%20environment%20and%20Exchange%20Online.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat's%20the%20best%20way%20to%20do%20this%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAppreciate%20any%20advice.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2390653%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExchange%20Online%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExchange%20Server%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EHybrid%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2390870%22%20slang%3D%22en-US%22%3ERe%3A%20Export%20all%20distribution%20lists%20from%20on-premise%20Exchange%20and%20Exchange%20Online%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2390870%22%20slang%3D%22en-US%22%3EHi%20Navishkar%20Sadheo%2C%3CBR%20%2F%3EFirst%20I%20need%20to%20ask%20some%20questions.%3CBR%20%2F%3EWhat%20do%20you%20want%20to%20achieve%20with%20the%20exported%20data%3F%20%3CBR%20%2F%3EDo%20you%20want%20to%20use%20the%20exported%20data%20for%20creating%20the%20same%20DLs%20in%20another%20environment%2C%20or%20is%20it%20%22just%22%20for%20documentation%20purposes%3F%3CBR%20%2F%3E-Thomas%3C%2FLINGO-BODY%3E
Regular Contributor

Hi all

Hope everyone is well.

 

We are in the midst of a migration and I need to export all distribution lists from our Exchange on-premise environment and Exchange Online.

 

What's the best way to do this?

 

Appreciate any advice.

3 Replies
Hi Navishkar Sadheo,
First I need to ask some questions.
What do you want to achieve with the exported data?
Do you want to use the exported data for creating the same DLs in another environment, or is it "just" for documentation purposes?
-Thomas
Hi Thomas.

We need to recreate the dist lists in the new tenant.

@Navishkar Sadheo 
Seven Zhou provides a solution for such a request in this post

You can run the same cmdlets in step 2 from that approach in an on-premises Exchange organization as well. 

 

Quote

  1. Open Windows PowerShell and connect to Exchange Online PowerShell. Here are the commands:

    Install-Module ExchangeOnlineManagement (Enter Y to install the module)
    Connect-ExchangeOnline (Sign in using an admin account and password)

  2. Then run the following script to get a CSV file about Distribution list.

$Groups = Get-DistributionGroup

$Groups | ForEach-Object {

$group = $_.Name

$members = ''

Get-DistributionGroupMember $group | ForEach-Object {

$members=$_.Name

New-Object -TypeName PSObject -Property @{

GroupName = $group

Members = $members

EmailAddress = $_.PrimarySMTPAddress

}}

} | Export-CSV "C:\DistributionGroupMember.csv" -NoTypeInformation -Encoding UTF8

 

Use the exported CSV file as an input file for creating the distribution list in the new EXO tenant.

-Thomas