Migrate · 1 tool
Migration batch in-progress report
Summary
The daily report for a mailbox migration: every user in the active batches with status, percent complete, size, skipped items and the error summary, split into one CSV per status.
Implementation
Choose your tool. Your choice is remembered on other samples.
Connect-ExchangeOnline -ShowBanner:$false
$batches = Get-MigrationBatch | Where-Object Status -notin "Completed", "Stopped"
$rows = foreach ($b in $batches) {
foreach ($u in Get-MigrationUser -BatchId $b.Identity.Name -ResultSize Unlimited) {
$s = Get-MigrationUserStatistics -Identity $u.Identity
[pscustomobject]@{ Batch = $b.Identity.Name; User = $u.Identity; Status = $s.Status; Percent = $s.PercentageComplete
Size = "$($s.TotalItemSize)"; Skipped = $s.SkippedItemCount; Error = "$($s.ErrorSummary)" }
}
}
$rows | Group-Object Batch, Status | Select-Object Name, Count | Format-Table
$rows | Group-Object Status | ForEach-Object { $_.Group | Export-Csv ".\inprogress-$($_.Name).csv" -NoTypeInformation }Prerequisites
- Exchange Administrator in the target tenant
Output
One CSV per status (Synced, Failed, Syncing and so on) and a summary table.
Contributors
| Author | Role |
|---|---|
| Priyanshu Upadhyay | Solution Architect, Microsoft 365 and Azure |
InnovaticT