I've an Hybrid setup with Exchange On-Premise and O365.
What i want to do is export Exchange On-Premise distribution list with members (what i already done it) with the following code (Found in internet):
$Result=@()
$groups = Get-DistributionGroup -ResultSize Unlimited`
$totalmbx = $groups.Count
$i = 1
$groups | ForEach-Object {
Write-Progress -activity "Processing $_.DisplayName" -status "$i out of $totalmbx completed"
$group = $_
Get-DistributionGroupMember -Identity $group.Name -ResultSize Unlimited | ForEach-Object {
$member = $_
$Result += New-Object PSObject -property @{
GroupName = $group.DisplayName
Member = $member.Name
EmailAddress = $member.PrimarySMTPAddress
RecipientType= $member.RecipientType
}}
$i++
}
$Result | Export-CSV "C:\Folder\FileName.csv" -NoTypeInformation -Encoding UTF8
I want to stop the sync from Exchange On-Premise to O365 and create directly the DL's in O365.
Can i import this exported list with members directly? If so can you please help me telling how?
Thanks in advance.