Commands › Exchange Online

New-MailboxExportRequest

Exchange Online ExchangeOnlineManagement New-*

Begin the process of exporting contents of a primary mailbox or archive to a .pst file. 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

# New-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)
New-MailboxExportRequest -Mailbox <MailboxOrMailUserIdParameter> -ComplianceStorePath <String> -FilePath <LongPath> -WhatIf
New-MailboxExportRequest -Mailbox <MailboxOrMailUserIdParameter> -ComplianceStorePath <String> -FilePath <LongPath>

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

Syntax — 3 parameter sets

Mailbox (Default)

New-MailboxExportRequest [-Mailbox] <MailboxOrMailUserIdParameter> -FilePath <LongPath>
 [-AcceptLargeDataLoss]
 [-AssociatedMessagesCopyOption <FAICopyOption>]
 [-BadItemLimit <Unlimited>]
 [-BatchName <String>]
 [-CompletedRequestAgeLimit <Unlimited>]
 [-Confirm]
 [-ConflictResolutionOption <ConflictResolutionOption>]
 [-ContentFilter <String>]
 [-ContentFilterLanguage <CultureInfo>]
 [-DomainController <Fqdn>]
 [-ExcludeDumpster]
 [-ExcludeFolders <String[]>]
 [-IncludeFolders <String[]>]
 [-InternalFlags <InternalMrsFlag[]>]
 [-IsArchive]
 [-LargeItemLimit <Unlimited>]
 [-MRSServer <Fqdn>]
 [-Name <String>]
 [-Priority <RequestPriority>]
 [-RemoteCredential <PSCredential>]
 [-RemoteHostName <Fqdn>]
 [-SkipMerging <SkippableMergeComponent[]>]
 [-SourceRootFolder <String>]
 [-Suspend]
 [-SuspendComment <String>]
 [-TargetRootFolder <String>]
 [-WhatIf]
 [-WorkloadType <RequestWorkloadType>]
 [<CommonParameters>]

MailboxExportRequest

New-MailboxExportRequest [-Mailbox] <MailboxLocationIdParameter> -FilePath <LongPath>
 [-AcceptLargeDataLoss]
 [-AssociatedMessagesCopyOption <FAICopyOption>]
 [-BadItemLimit <Unlimited>]
 [-BatchName <String>]
 [-CompletedRequestAgeLimit <Unlimited>]
 [-Confirm]
 [-ConflictResolutionOption <ConflictResolutionOption>]
 [-ContentFilter <String>]
 [-ContentFilterLanguage <CultureInfo>]
 [-DomainController <Fqdn>]
 [-ExcludeDumpster]
 [-ExcludeFolders <String[]>]
 [-IncludeFolders <String[]>]
 [-InternalFlags <InternalMrsFlag[]>]
 [-IsArchive]
 [-LargeItemLimit <Unlimited>]
 [-Name <String>]
 [-Priority <RequestPriority>]
 [-RemoteCredential <PSCredential>]
 [-RemoteHostName <Fqdn>]
 [-RequestExpiryInterval <Unlimited>]
 [-SkipMerging <SkippableMergeComponent[]>]
 [-SourceRootFolder <String>]
 [-Suspend]
 [-SuspendComment <String>]
 [-TargetRootFolder <String>]
 [-WhatIf]
 [-WorkloadType <RequestWorkloadType>]
 [<CommonParameters>]

MailboxComplianceExportRequest

New-MailboxExportRequest [-Mailbox] <MailboxLocationIdParameter> -ComplianceStorePath <String> -RemoteCredential <PSCredential>
 [-AcceptLargeDataLoss]
 [-BadItemLimit <Unlimited>]
 [-BatchName <String>]
 [-CompletedRequestAgeLimit <Unlimited>]
 [-Confirm]
 [-ContentFilter <String>]
 [-ContentFilterLanguage <CultureInfo>]
 [-DomainController <Fqdn>]
 [-InternalFlags <InternalMrsFlag[]>]
 [-IsArchive]
 [-LargeItemLimit <Unlimited>]
 [-Name <String>]
 [-PreferredMessageFormat <MessageCopyFormat>]
 [-Priority <RequestPriority>]
 [-RequestExpiryInterval <Unlimited>]
 [-SkipMerging <SkippableMergeComponent[]>]
 [-Suspend]
 [-SuspendComment <String>]
 [-WhatIf]
 [-WorkloadType <RequestWorkloadType>]
 [<CommonParameters>]

Parameters (33)

ParameterTypeRequiredWhat it controls
-Mailbox MailboxOrMailUserIdParameter yes The Mailbox parameter specifies the source mailbox where the contents are being exported from.
-ComplianceStorePath String yes This parameter is reserved for internal Microsoft use.
-FilePath LongPath yes The FilePath parameter specifies the network share path of the .pst file to which data is exported, for example, \\\\SERVER01\\PST Files\\exported.pst.
-RemoteCredential PSCredential This parameter is reserved for internal Microsoft use.
-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.
-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 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 a descriptive name for exporting a batch of mailboxes. You can use the name in the BatchName parameter as a string search when you use the Get-MailboxExportRequest cmdlet.
-CompletedRequestAgeLimit Unlimited The CompletedRequestAgeLimit parameter specifies how long the request is kept after completion before it's automatically removed. The default value is 30 days.
-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 **Important**: You can't use this parameter to export between two dates. You can export from a specific date, or export to a specific date, but not both.
-ContentFilterLanguage CultureInfo The ContentFilterLanguage parameter specifies the language being used in the ContentFilter parameter for string searches.
-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...
-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 export.
-IncludeFolders String[] The IncludeFolders parameter specifies the list of folders to include during the export.
-InternalFlags InternalMrsFlag[] The InternalFlags parameter specifies the optional steps in the request. This parameter is used primarily for debugging purposes.
-IsArchive SwitchParameter The IsArchive switch specifies that you're exporting from the user's archive. You don't need to specify a value with this switch.
-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...
-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 export requests per mailbox, Exchange precedes the name with the mailbox's alias. For...
-PreferredMessageFormat MessageCopyFormat This parameter is reserved for internal Microsoft use.
-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...
-RemoteHostName Fqdn This parameter is reserved for internal Microsoft use.
-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...
-SkipMerging SkippableMergeComponent[] The SkipMerging parameter specifies steps in the export that should be skipped. This parameter is used primarily for debugging purposes.
-SourceRootFolder String The SourceRootFolder parameter specifies the root folder of the mailbox from which data is exported. If this parameter isn't specified, the command exports 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.
-TargetRootFolder String yes The TargetRootFolder parameter specifies the top-level folder in which to export data. If you don't specify this parameter, the command exports folders to the top of the folder structure in the target .pst file....
-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 reserved for internal Microsoft use.

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