May 27 2021 02:45 AM
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.
May 27 2021 03:51 AM
May 27 2021 04:46 AM
May 27 2021 05:15 AM
@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
$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