Commands › Exchange Online

Set-MailboxExportRequest

Exchange Online ExchangeOnlineManagement Set-*

Change export request options after the request is created. You can use the Set-MailboxExportRequest cmdlet to recover from failed export requests. To use this cmdlet, you need to add the Mailbox Import Export role to a role group (for example, to the Organization Management role group). For more information, see Add a role to a role group.

Quick start script

# Set-MailboxExportRequest — 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-MailboxExportRequest
$before | Format-List

# 3. Make the change (dry run first)
Set-MailboxExportRequest -Identity <MailboxExportRequestIdParameter> -RehomeRequest <SwitchParameter> -WhatIf
Set-MailboxExportRequest -Identity <MailboxExportRequestIdParameter> -RehomeRequest <SwitchParameter>

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

Syntax — 2 parameter sets

Rehome

Set-MailboxExportRequest [-Identity] <MailboxExportRequestIdParameter>
 [-RehomeRequest]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-RequestExpiryInterval <Unlimited>]
 [-WhatIf]
 [<CommonParameters>]

Identity

Set-MailboxExportRequest [-Identity] <MailboxExportRequestIdParameter>
 [-AcceptLargeDataLoss]
 [-BadItemLimit <Unlimited>]
 [-BatchName <String>]
 [-CompletedRequestAgeLimit <Unlimited>]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-InternalFlags <InternalMrsFlag[]>]
 [-LargeItemLimit <Unlimited>]
 [-Priority <RequestPriority>]
 [-RemoteCredential <PSCredential>]
 [-RemoteHostName <Fqdn>]
 [-RequestExpiryInterval <Unlimited>]
 [-SkipMerging <SkippableMergeComponent[]>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (16)

ParameterTypeRequiredWhat it controls
-Identity MailboxExportRequestIdParameter yes The Identity parameter specifies the identity of the export request. By default, export requests are named `<alias>\MailboxExportX` (where X = 0-9). If you specify a name for the export request, use the following...
-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.
-BadItemLimit Unlimited The BadItemLimit parameter specifies the maximum number of bad items that are allowed before the request fails. A bad item is a corrupt item in the source mailbox that can't be copied to the target mailbox. Also...
-BatchName String The BatchName parameter specifies the name of the batch.
-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.
-CompletedRequestAgeLimit Unlimited The CompletedRequestAgeLimit parameter specifies how long the request is kept after it has completed before being automatically removed. The default value is 30 days.
-DomainController Fqdn The DomainController parameter specifies the domain controller that's used by this cmdlet to read data from or write data to Active Directory. You identify the domain controller by its fully qualified domain name...
-InternalFlags InternalMrsFlag[] The InternalFlags parameter specifies the optional steps in the request. This parameter is used primarily for debugging purposes.
-LargeItemLimit Unlimited The LargeItemLimit parameter specifies the maximum number of large items that are allowed before the request fails. A large item is a message in the source mailbox that exceeds the maximum message size that's allowed...
-Priority RequestPriority The Priority parameter specifies the order in which the request should be processed in the request queue. Requests are processed in order, based on server health, status, priority, and last update time. Valid...
-RehomeRequest SwitchParameter yes The RehomeRequest switch tells the Microsoft Exchange Mailbox Replication service (MRS) that the request needs to be moved to the same database as the mailbox that's being exported. You don't need to specify a value...
-RemoteCredential PSCredential This parameter is reserved for internal Microsoft use.
-RemoteHostName Fqdn This parameter is reserved for internal Microsoft use.
-SkipMerging SkippableMergeComponent[] The SkipMerging parameter specifies steps in the export that should be skipped. This parameter is used primarily for debugging purposes.
-RequestExpiryInterval Unlimited The RequestExpiryInterval parameter specifies an age limit for a completed or failed request. When you use this parameter, the completed or failed request is automatically removed after the specified interval...
-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.

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