After successful migration, you can upgrade eligible distribution groups to Microsoft 365 Groups for enhanced collaboration features. This step is optional but recommended for groups that need modern collaboration tools.
# Check which groups are eligible for upgrade to Microsoft 365 Groups
Get-DistributionGroup -Filter "Name -like 'C-*'" | ForEach-Object {
try {
$EligibilityCheck = Get-EligibleDistributionGroupForMigration -Identity $_.Name
[PSCustomObject]@{
GroupName = $_.Name
PrimarySmtpAddress = $_.PrimarySmtpAddress
Eligible = $EligibilityCheck.IsEligibleForUpgrade
Reasons = ($EligibilityCheck.IneligibilityReasons -join "; ")
}
}
catch {
[PSCustomObject]@{
GroupName = $_.Name
PrimarySmtpAddress = $_.PrimarySmtpAddress
Eligible = $false
Reasons = "Error checking eligibility: $($_.Exception.Message)"
}
}
} | Format-Table -AutoSize
Upgrade eligible groups to Microsoft 365 Groups:
# Upgrade eligible distribution groups to Microsoft 365 Groups
$EligibleGroups = Get-DistributionGroup -Filter "Name -like 'C-*'" | Where-Object {
try {
$Check = Get-EligibleDistributionGroupForMigration -Identity $_.Name
return $Check.IsEligibleForUpgrade
}
catch {
return $false
}
}
foreach ($Group in $EligibleGroups) {
try {
Write-Host "Upgrading $($Group.Name) to Microsoft 365 Group..." -ForegroundColor Yellow
# Initiate the upgrade
Upgrade-DistributionGroup -DlIdentities $Group.PrimarySmtpAddress
Write-Host "✓ Upgrade initiated for $($Group.Name)" -ForegroundColor Green
Write-Host " Note: Upgrade process may take several minutes to complete" -ForegroundColor Cyan
}
catch {
Write-Host "✗ Failed to upgrade $($Group.Name): $($_.Exception.Message)" -ForegroundColor Red
}
}
Monitor upgrade progress and verify Microsoft 365 Groups:
# Check upgrade status (run this after 10-15 minutes)
Write-Host "Checking for new Microsoft 365 Groups..." -ForegroundColor Yellow
# List Microsoft 365 Groups that were created from distribution groups
Get-UnifiedGroup | Where-Object {$_.DisplayName -like "C-*"} |
Select-Object DisplayName, PrimarySmtpAddress, WhenCreated, GroupType |
Format-Table -AutoSize
# Verify group features are available
Get-UnifiedGroup | Where-Object {$_.DisplayName -like "C-*"} | Select-Object -First 1 | ForEach-Object {
Write-Host "\nFeatures available for $($_.DisplayName):" -ForegroundColor Cyan
Write-Host "- SharePoint Site: $($_.SharePointSiteUrl)" -ForegroundColor Green
Write-Host "- Teams Integration: Available" -ForegroundColor Green
Write-Host "- Planner: Available" -ForegroundColor Green
Write-Host "- Calendar: Available" -ForegroundColor Green
}
Final cleanup and documentation:
# Generate final migration and upgrade report
$FinalReport = @{
MigrationDate = Get-Date
DistributionGroupsMigrated = (Get-DistributionGroup -Filter "Name -like 'C-*'").Count
Microsoft365GroupsCreated = (Get-UnifiedGroup | Where-Object {$_.DisplayName -like "C-*"}).Count
RemainingDistributionGroups = (Get-DistributionGroup -Filter "Name -like 'C-*' -and RecipientTypeDetails -eq 'MailUniversalDistributionGroup'").Count
}
$FinalReport | ConvertTo-Json | Out-File "C:\Scripts\CompleteMigrationReport.json"
Write-Host "\n=== FINAL MIGRATION REPORT ===" -ForegroundColor Cyan
Write-Host "Migration completed on: $($FinalReport.MigrationDate)" -ForegroundColor Green
Write-Host "Distribution groups migrated: $($FinalReport.DistributionGroupsMigrated)" -ForegroundColor Green
Write-Host "Upgraded to Microsoft 365 Groups: $($FinalReport.Microsoft365GroupsCreated)" -ForegroundColor Green
Write-Host "Remaining as distribution groups: $($FinalReport.RemainingDistributionGroups)" -ForegroundColor Yellow
Write-Host "\nMigration complete! All reports saved to C:\Scripts\" -ForegroundColor Cyan
Pro tip: Microsoft 365 Groups provide additional features like SharePoint sites, Teams integration, and Planner. Consider upgrading groups that need these collaboration features.