Get-MailboxRestoreRequest: Check Mailbox Restore Status in PowerShell

4 min read James Futhey First published March 21, 2024
Microsoft Learn documentation for the Get-MailboxRestoreRequest cmdlet showing its PowerShell syntax

Quick answer: Get-MailboxRestoreRequest lists the restore requests you started with New-MailboxRestoreRequest and shows each one's status. It works in Exchange Online and in Exchange Server 2010 through SE. For percent complete and error details, pipe the request to Get-MailboxRestoreRequestStatistics.

Get-MailboxRestoreRequest
Get-MailboxRestoreRequest -Status Failed | Get-MailboxRestoreRequestStatistics -IncludeReport

How restore requests work

A restore request copies content from a soft-deleted or disconnected mailbox into an existing mailbox. You create it with New-MailboxRestoreRequest, and the Mailbox Replication service runs it in the background. These cmdlets cover the rest of its life:

Cmdlet What it does
Get-MailboxRestoreRequest Lists requests and their status
Get-MailboxRestoreRequestStatistics Shows progress, item counts and error reports
Set-MailboxRestoreRequest Changes settings on a request, such as the bad item limit
Suspend-MailboxRestoreRequest Pauses a request
Resume-MailboxRestoreRequest Restarts a suspended or failed request
Remove-MailboxRestoreRequest Deletes a request, finished or not

To bring back a whole soft-deleted mailbox as itself rather than merging it into another one, see Undo-SoftDeletedMailbox.

Syntax

There are 2 parameter sets. Use -Identity to get one request, or the filter parameters to find several. You can't mix them.

# Identity
Get-MailboxRestoreRequest
    [[-Identity] <MailboxRestoreRequestIdParameter>]
    [-DomainController <Fqdn>]
    [-ResultSize <Unlimited>]
    [<CommonParameters>]

# Filtering
Get-MailboxRestoreRequest
    [-BatchName <String>]
    [-HighPriority <Boolean>]
    [-Name <String>]
    [-RequestQueue <DatabaseIdParameter>]
    [-SourceDatabase <DatabaseIdParameter>]
    [-Status <RequestStatus>]
    [-Suspend <Boolean>]
    [-TargetDatabase <DatabaseIdParameter>]
    [-TargetMailbox <MailboxOrMailUserIdParameter>]
    [-DomainController <Fqdn>]
    [-ResultSize <Unlimited>]
    [<CommonParameters>]

Parameters

Parameter Where it works What it does
-Identity Online and on-premises One request, in the form Alias\Name. Alias is the target mailbox and Name is the request name.
-Status Online and on-premises Filters by status. See the values below.
-TargetMailbox Online and on-premises Requests that restore into this mailbox. Takes an alias, SMTP address, UPN, GUID or DN.
-Name Online and on-premises Requests with this name.
-BatchName Online and on-premises Requests in this batch.
-Suspend Online and on-premises $true returns suspended requests.
-HighPriority Online and on-premises $true returns requests with High, Higher, Highest or Emergency priority. $false returns Normal, Low, Lower or Lowest.
-ResultSize Online and on-premises The most results to return. The default is 1000. Use unlimited for all.
-SourceDatabase On-premises only Requests restoring from this database.
-RequestQueue Exchange 2013 and later, on-premises Requests running on this mailbox database.
-TargetDatabase Exchange 2010 only Requests restoring to this database.
-DomainController On-premises only The domain controller to read from, such as dc01.contoso.com.

Request names

If you didn't name the request, Exchange calls it MailboxRestore. A mailbox can have up to 10 requests with default names: MailboxRestore, then MailboxRestore1 through MailboxRestore9. So the identity of the first unnamed restore into Adele's mailbox is adele\MailboxRestore.

Passing $null or a value that doesn't exist to -Identity returns every request, as if you'd left it out. Check your variable before you pipe the result into Remove-MailboxRestoreRequest.

Status values

-Status takes these values: AutoSuspended, Completed, CompletedWithWarning, CompletionInProgress, Failed, InProgress, Queued, Retrying, Suspended and Synced.

Examples

1. List every restore request

Get-MailboxRestoreRequest -ResultSize Unlimited |
    Format-Table Name, TargetMailbox, Status, BatchName

2. Get one request

Get-MailboxRestoreRequest -Identity 'adele\MailboxRestore'

3. Find requests that need attention

Get-MailboxRestoreRequest -Status Failed
Get-MailboxRestoreRequest -Status AutoSuspended
Get-MailboxRestoreRequest -Suspend $true

4. See all restores into one mailbox

Get-MailboxRestoreRequest -TargetMailbox adele.vance@contoso.com

5. Check progress

Get-MailboxRestoreRequest -TargetMailbox adele.vance@contoso.com |
    Get-MailboxRestoreRequestStatistics |
    Format-Table Name, Status, PercentComplete

Get-MailboxRestoreRequest only shows the status. The statistics cmdlet adds percent complete and item counts.

6. Find out why a restore failed

Get-MailboxRestoreRequestStatistics -Identity 'adele\MailboxRestore' -IncludeReport |
    Format-List

-IncludeReport adds the troubleshooting log. Look near the end for the failure message, which often names a corrupt item or a bad item limit that was reached. To save reports for every failed request at once:

Get-MailboxRestoreRequest -Status Failed |
    Get-MailboxRestoreRequestStatistics -IncludeReport |
    Format-List > C:\Reports\FailedRestores.txt

7. Export statistics to CSV

Get-MailboxRestoreRequest |
    Get-MailboxRestoreRequestStatistics |
    Export-Csv -Path C:\Reports\RestoreStats.csv -NoTypeInformation

8. Resume failed requests

Get-MailboxRestoreRequest -Status Failed | Resume-MailboxRestoreRequest

If the same request fails again, read its report from example 6 before you resume it a second time.

9. Clean up completed requests

Get-MailboxRestoreRequest -Status Completed | Remove-MailboxRestoreRequest

Completed requests stay in the list until you remove them. Clearing them out also frees up the default names for the next unnamed restore into the same mailbox.

10. Requests on one database (on-premises)

Get-MailboxRestoreRequest -RequestQueue MBX01

In Exchange 2010, use -TargetDatabase MBX01 instead.

Get-MailboxRestoreRequestStatistics parameters

Parameter Where it works What it does
-Identity Online and on-premises The request, in the form Alias\Name. Accepts pipeline input.
-IncludeReport Online and on-premises Adds the detailed log for troubleshooting.
-ReportOnly Exchange 2016 and later, and Online Returns only the report entries.
-IncludeSkippedItems Exchange Online only Listed in the syntax. Learn doesn't describe it yet.
-DiagnosticInfo Exchange Online only Extra detail, mainly for Microsoft Support.
-Diagnostic, -DiagnosticArgument Exchange 2013 and later, on-premises Very detailed output, mainly for Microsoft Support.
-RequestQueue Exchange 2013 and later, on-premises Every request on a database. Learn says this is for debugging only.

Permissions

You need permissions assigned before you can run these cmdlets, and some parameters may not be available if your role doesn't include them. Microsoft's article on finding the permissions required to run any Exchange cmdlet shows how to check your role. In Exchange Online, connect first with Connect-ExchangeOnline.

Troubleshooting

Nothing comes back. No requests exist, or they were removed after they completed. Check that you're connected to the right organization.

"Parameter set cannot be resolved using the specified named parameters." You combined -Identity with a filter such as -Status. They're in different parameter sets. Use one or the other.

"A parameter cannot be found that matches parameter name 'SourceDatabase'." You're connected to Exchange Online. -SourceDatabase, -RequestQueue, -TargetDatabase and -DomainController only work on-premises.

The request stays at Queued. The Mailbox Replication service hasn't picked it up yet. In Exchange Online that can take a while. Check again later before you change anything.

The request is AutoSuspended or Suspended. It's paused. Check the report from example 6 for a reason, then run Resume-MailboxRestoreRequest to let it continue.

FAQ

What's the difference between Get-MailboxRestoreRequest and Get-MailboxRestoreRequestStatistics?

Get-MailboxRestoreRequest finds requests and shows their status. Get-MailboxRestoreRequestStatistics shows the details of a request you already know about: percent complete, items transferred and the error report.

Does Get-MailboxRestoreRequest work in Exchange Online?

Yes. Microsoft lists it for Exchange Online and Exchange Server 2010, 2013, 2016, 2019 and SE. The database parameters only work on-premises.

How do I find the size of a mailbox before or after a restore?

Use Get-MailboxStatistics, which shows item count and total size.

Add a display to your office

Every room, on the door.

Live availability on every meeting room. Works with Microsoft 365, Exchange and Google Workspace.