Commands › Exchange Online

New-MailboxRestoreRequest

Exchange Online ExchangeOnlineManagement New-*

Restore a soft-deleted or disconnected mailbox. This cmdlet starts the process of moving content from the soft-deleted mailbox, disabled mailbox, or any mailbox in a recovery database into a connected primary or archive mailbox. The properties used to find disconnected mailboxes and restore a mailbox are different in Exchange Server and Exchange Online. For more information about Exchange Online, see Restore an inactive mailbox.

Quick start script

# New-MailboxRestoreRequest — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-MailboxRestoreRequest
$before | Format-List

# 3. Make the change (dry run first)
New-MailboxRestoreRequest -CrossTenantRestore <SwitchParameter> -RemoteCredential <PSCredential> -RemoteDatabaseGuid <Guid> -WhatIf
New-MailboxRestoreRequest -CrossTenantRestore <SwitchParameter> -RemoteCredential <PSCredential> -RemoteDatabaseGuid <Guid>

# 4. Verify and diff
$after = Get-MailboxRestoreRequest
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax — 6 parameter sets

Default

New-MailboxRestoreRequest -SourceDatabase <DatabaseIdParameter> -SourceStoreMailbox <StoreMailboxIdParameter> -TargetMailbox <MailboxOrMailUserIdParameter>
 [-AcceptLargeDataLoss]
 [-AllowLegacyDNMismatch]
 [-AssociatedMessagesCopyOption <FAICopyOption>]
 [-BadItemLimit <Unlimited>]
 [-BatchName <String>]
 [-Confirm]
 [-ConflictResolutionOption <ConflictResolutionOption>]
 [-DomainController <Fqdn>]
 [-ExcludeDumpster]
 [-ExcludeFolders <String[]>]
 [-IncludeFolders <String[]>]
 [-MRSServer <Fqdn>]
 [-Name <String>]
 [-Priority <RequestPriority>]
 [-SourceRootFolder <String>]
 [-SuspendComment <String>]
 [-Suspend]
 [-TargetIsArchive]
 [-TargetRootFolder <String>]
 [-WhatIf]
 [<CommonParameters>]

CrossTenantRestore

New-MailboxRestoreRequest -SourceEndpoint <MigrationEndpointIdParameter> -SourceExchangeGuid <Guid> -SourceTenant <SmtpDomain> -TargetMailbox <MailboxLocationIdParameter>
 [-AcceptLargeDataLoss]
 [-AllowLegacyDNMismatch]
 [-AssociatedMessagesCopyOption <FAICopyOption>]
 [-BadItemLimit <Unlimited>]
 [-BatchName <String>]
 [-CompletedRequestAgeLimit <Unlimited>]
 [-Confirm]
 [-ConflictResolutionOption <ConflictResolutionOption>]
 [-ContentFilter <String>]
 [-ContentFilterLanguage <CultureInfo>]
 [-CrossTenantRestore]
 [-DomainController <Fqdn>]
 [-ExcludeDumpster]
 [-ExcludeFolders <String[]>]
 [-IncludeFolders <String[]>]
 [-LargeItemLimit <Unlimited>]
 [-Name <String>]
 [-SkipMerging <SkippableMergeComponent[]>]
 [-SourceRootFolder <String>]
 [-SuspendComment <String>]
 [-Suspend]
 [-TargetIsArchive]
 [-TargetRootFolder <String>]
 [-TargetType <TargetTypeComponent>]
 [-WhatIf]
 [<CommonParameters>]

MigrationLocalMailboxRestore

New-MailboxRestoreRequest -SourceDatabase <DatabaseIdParameter> -SourceStoreMailbox <StoreMailboxIdParameter>>
 [-AcceptLargeDataLoss]
 [-AllowLegacyDNMismatch]
 [-AssociatedMessagesCopyOption <FAICopyOption>]
 [-BadItemLimit <Unlimited>]
 [-BatchName <String>]
 [-CompletedRequestAgeLimit <Unlimited>]
 [-Confirm]
 [-ConflictResolutionOption <ConflictResolutionOption>]
 [-ContentFilter <String>]
 [-ContentFilterLanguage <CultureInfo>]
 [-DomainController <Fqdn>]
 [-ExcludeDumpster]
 [-ExcludeFolders <String[]>]
 [-IncludeFolders <String[]>]
 [-InternalFlags <InternalMrsFlag[]>]
 [-LargeItemLimit <Unlimited>]
 [-Name <String>]
 [-Priority <RequestPriority>]
 [-RequestExpiryInterval <Unlimited>]
 [-SkipMerging <SkippableMergeComponent[]>]
 [-SourceRootFolder <String>]
 [-Suspend]
 [-SuspendComment <String>]
 [-TargetIsArchive]
 [-TargetRootFolder <String>]
 [-TargetType <TargetTypeComponent>]
 [-WhatIf]
 [-WorkloadType <RequestWorkloadType>]
 [<CommonParameters>]

RemoteMailboxRestoreMailboxLocationId

New-MailboxRestoreRequest -SourceStoreMailbox <StoreMailboxIdParameter> -TargetMailbox <MailboxLocationIdParameter>
 [-AcceptLargeDataLoss]
 [-AllowLegacyDNMismatch]
 [-AssociatedMessagesCopyOption <FAICopyOption>]
 [-BadItemLimit <Unlimited>]
 [-BatchName <String>]
 [-CompletedRequestAgeLimit <Unlimited>]
 [-Confirm]
 [-ConflictResolutionOption <ConflictResolutionOption>]
 [-ContentFilter <String>]
 [-ContentFilterLanguage <CultureInfo>]
 [-DomainController <Fqdn>]
 [-ExcludeDumpster]
 [-ExcludeFolders <String[]>]
 [-IncludeFolders <String[]>]
 [-InternalFlags <InternalMrsFlag[]>]
 [-LargeItemLimit <Unlimited>]
 [-Name <String>]
 [-Priority <RequestPriority>]
 [-RequestExpiryInterval <Unlimited>]
 [-SkipMerging <SkippableMergeComponent[]>]
 [-SourceRootFolder <String>]
 [-Suspend]
 [-SuspendComment <String>]
 [-TargetIsArchive]
 [-TargetRootFolder <String>]
 [-TargetType <TargetTypeComponent>]
 [-WhatIf]
 [-WorkloadType <RequestWorkloadType>]
 [<CommonParameters>]

2 more parameter sets — see the parameter table below.

Parameters (42)

ParameterTypeRequiredWhat it controls
-CrossTenantRestore SwitchParameter yes This parameter is available only in the cloud-based service.
-RemoteCredential PSCredential yes This parameter is available only in the cloud-based service.
-RemoteDatabaseGuid Guid yes This parameter is available only in the cloud-based service.
-RemoteHostName Fqdn yes This parameter is available only in the cloud-based service.
-RemoteRestoreType RemoteRestoreType yes This parameter is available only in the cloud-based service.
-SourceDatabase DatabaseIdParameter yes This parameter is available only in on-premises Exchange.
-SourceEndpoint MigrationEndpointIdParameter yes This parameter is available only in the cloud-based service.
-SourceExchangeGuid Guid yes This parameter is available only in the cloud-based service.
-SourceMailbox SourceMailbox yes The SourceMailbox parameter specifies the soft-deleted mailbox that you want to restore. The best way to identify the soft-deleted mailbox is by its GUID value. You can find the GUID value by running the following...
-SourceStoreMailbox StoreMailboxIdParameter yes This parameter is functional only in on-premises Exchange.
-SourceTenant SmtpDomain yes This parameter is available only in the cloud-based service.
-TargetMailbox MailboxLocationIdParameter yes The TargetMailbox parameter specifies the GUID of the target mailbox or mail user where you want to restore content to. The target mailbox or mail user needs to exist before you can run this command successfully.
-AcceptLargeDataLoss SwitchParameter The AcceptLargeDataLoss switch specifies the request should continue even if a large number of items in the source mailbox can't be copied to the target mailbox. You don't need to specify a value with this switch.
-AllowLegacyDNMismatch SwitchParameter The AllowLegacyDNMismatch switch specifies that the operation should continue if the LegacyExchangeDN of the source physical mailbox and the target mailbox don't match. You don't need to specify a value with this switch.
-AssociatedMessagesCopyOption FAICopyOption The AssociatedMessagesCopyOption parameter specifies whether associated messages are copied when the request is processed. Associated messages are special messages that contain hidden data with information about...
-BadItemLimit Unlimited This parameter is available only in on-premises Exchange.
-BatchName String The BatchName parameter specifies a descriptive name for restoring a batch of mailboxes. You can use the name in the BatchName parameter as a string search when you use the Get-MailboxRestoreRequest cmdlet.
-CompletedRequestAgeLimit Unlimited The CompletedRequestAgeLimit parameter specifies how long the status of a completed restore request is set to Completed. If this parameter is set to a value of 0, the status is cleared immediately instead of being...
-Confirm SwitchParameter The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on whether the cmdlet requires confirmation before proceeding.
-ConflictResolutionOption ConflictResolutionOption The ConflictResolutionOption parameter specifies what to do if there are multiple matching messages in the target. Valid values are:
-ContentFilter String This parameter is available only in the cloud-based service.
-ContentFilterLanguage CultureInfo This parameter is available only in the cloud-based service.
-DomainController Fqdn This parameter is functional only in on-premises Exchange.
-ExcludeDumpster SwitchParameter The ExcludeDumpster switch specifies whether to exclude the Recoverable Items folder. You don't need to specify a value with this switch.
-ExcludeFolders String[] The ExcludeFolders parameter specifies the list of folders to exclude during the restore request.
-IncludeFolders String[] The IncludeFolders parameter specifies the list of folder to include during the restore request.
-InternalFlags InternalMrsFlag[] This parameter is available only in on-premises Exchange.
-LargeItemLimit Unlimited This parameter is available only in on-premises Exchange.
-MRSServer Fqdn The MRSServer parameter specifies the FQDN of the Client Access server on which the instance of the Microsoft Exchange Mailbox Replication service (MRS) is running. This parameter is used for debugging purposes only....
-Name String The Name parameter specifies the name of the specific request for tracking and display purposes. Because you can have multiple restore requests per mailbox, Exchange precedes the name with the mailbox's alias. For...
-Priority RequestPriority This parameter is available only in on-premises Exchange.
-RequestExpiryInterval Unlimited This parameter is available only in on-premises Exchange.
-SkipMerging SkippableMergeComponent[] The SkipMerging parameter specifies folder-related items to skip when restoring the mailbox. Use one of the following values:
-SourceIsArchive SwitchParameter The SourceIsArchive switch specifies that the source mailbox is an archive mailbox. You don't need to specify a value with this switch.
-SourceRootFolder String The SourceRootFolder parameter specifies the root folder of the mailbox from which data is restored. If this parameter isn't specified, the command restores all folders.
-Suspend SwitchParameter The Suspend switch specifies whether to suspend the request. You don't need to specify a value with this switch.
-SuspendComment String The SuspendComment parameter specifies a description about why the request was suspended. You can only use this parameter if you specify the Suspend parameter.
-TargetIsArchive SwitchParameter The TargetIsArchive switch specifies that the content is restored into the specified target mailbox's archive. You don't need to specify a value with this switch.
-TargetRootFolder String The TargetRootFolder parameter specifies the top-level folder in which to restore data. If you don't specify this parameter, the command restores folders to the top of the folder structure in the target mailbox or...
-TargetType TargetTypeComponent The TargetType parameter specifies the type of mailbox that's the target for the restore operation. Valid values are:
-WhatIf SwitchParameter The WhatIf switch shows what the command does without making any changes. You don't need to specify a value with this switch.
-WorkloadType RequestWorkloadType This parameter is available only in on-premises Exchange.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.