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.

Exchange Online PowerShell
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

AuthorRole
Priyanshu UpadhyaySolution Architect, Microsoft 365 and Azure
Disclaimer. These samples are provided as is, without warranty of any kind. Read and test every script in a non-production tenant before you run it, and run reports before any command that changes or deletes data.