How to Use New-MailboxExportRequest Cmdlet in Exchange Server? (A Complete Guide)

info-icon Our content follows trusted Editorial Standards - accurate & unbiased.

Table of Contents

The PowerShell command - New-MailboxExportRequest - exports mailbox or personal archive to a PST file onto a shared network path. This requires the Mailbox Import Export RBAC role, which is not even assigned to an Exchange Server Administrator. This article will cover all the aspects of the command, along with all the parameters.

Commands related to Mailbox Export Request

  • New-MailboxExportRequest – Creates the export request.
  • Get-MailboxExportRequest – Check the status of the export.
  • Remove-MailboxExportRequest – Used to remove completed/failed requests.
  • Set-MailboxExportRequest – Resumes/modifies a suspended request.

What is New-MailboxExportRequest Command?

This PowerShell command is used to export user mailbox, shared mailbox, or user archive to PST file. This is ideal for exporting and distribution copies, since PST file is portable and used in any Microsoft Outlook without specific logins or profiles. It is dependent on the Microsoft Exchange Mailbox Replication (MRS) service, As this command runs in the background. there is no need to leave the PowerShell window open.

This command is available only in on-premises Exchange Server - from 2010 SP1 till the latest Subscription Edition (SE).

Important: The command does not support direct and local paths. The destination must be a UNC share path, for example, \\fileserver\share.

Here are some commands related to mailbox export.

 

Command

Purpose

When to use it

New-MailboxExportRequest

Creates a new mailbox export request

Exporting a new mailbox to PST

Get-MailboxExportRequest

Checks the status of export requests

Monitoring progress or finding failed exports

Remove-MailboxExportRequest

Removes completed or failed export requests

Cleaning up after export completes

Set-MailboxExportRequest

Modifies or resumes a suspended request

Resuming a failed or suspended export

Prerequisites for using New-MailboxExportRequest Command

Here are some requirements you need to meet to use this command.

1. Assign the Mailbox Import Export Role

This role is required for running the New-MailboxExportRequest command. However, it is not assigned - by default - to any user, even to the Enterprise Administrator.  Follow these steps to assign this role:

  • Launch the Exchange Management Shell (EMS).
  • Use the command below to assign the role to a user:

New-ManagementRoleAssignment -Role "Mailbox Import Export" -User username

Mailbox Import Export

You can also assign this role to a security group (a best approach). To do so, use the below-given command:

New-ManagementRoleAssignment -Role "Mailbox Import Export" -SecurityGroup "<group name>"

assign this role to a security group

Once it is successfully executed, close the EMS and open it again.

2. Create a Share Folder on the Network

To be able to export a mailbox, you must have a share on a server. This must be created with the right permissions in hand. Here are the steps:

  • Create the folder to host the PST files.
  • Right-click on the folder and click on Properties.
  • Click on the Sharing tab and click on Advanced Sharing.
  • Tick Share this folder and click on Permissions.

Click on the Sharing tab

  • Remove the Everyone option and add the user which will be accessing the share as well as the in-built Exchange Server group, called Exchange Trusted Subsystem. Select Full Control as permissions.

Select Full Control as permissions

3. Confirm that Microsoft Exchange Mailbox Replication (MRS) is Running

You should check that the service of the Mailbox Replication is running. This can be checked from Services Management window.

Confirm that Microsoft Exchange Mailbox Replication

Alternatively, you can also check this by using the PowerShell command as given below.

Get-Service -Name MSExchangeRepl | Select-Object Name, Status

check this by using the PowerShell command

If the service is not running, make sure that the service is started before exporting any mailboxes.

For more on MRS health monitoring, see Test-MRSHealth.

4. Have Sufficient Disk Space on the Target Share

This is very important for the export success. You must make sure that there is ample space on the destination path.

Syntax of New-MailboxExportRequest

Below is the full syntax of the command.

New-MailboxExportRequest [-Mailbox] <MailboxOrMailUserIdParameter> -FilePath <LongPath> [-Name <String>] [-BadItemLimit <Unlimited>] [-LargeItemLimit <Unlimited>] [-Priority <RequestPriority>] [-ExcludeFolders <String[]>] [-IncludeFolders <String[]>] [-ContentFilter <String>] [-Confirm] [-WhatIf]

Let’s understand the different parameters used with the command.

 

Parameter

Required?

Description

-Mailbox

Required

The mailbox to export. Accepts email address, alias, display name, or GUID.

-FilePath

Required

UNC path for the output PST file. Must be a network share (e.g. \\server\share\Export.pst). Local paths not supported.

-Name

Optional

Name for the export request. Default: MailboxExport. Use a unique name if running multiple exports for the same mailbox.

-BadItemLimit

Optional

Number of corrupt items to skip before the export fails. Default: 0. Set to Unlimited for corrupt mailboxes.

-LargeItemLimit

Optional

Number of items exceeding the maximum size limit to skip. Default: 0.

-Priority

Optional

Request priority: Emergency, Highest, Higher, High, Normal, Low, Lower, Lowest. Default: Normal.

-IncludeFolders

Optional

Export only specific folders. E.g. #Inbox#, #SentItems#, \Subfolder.

-ExcludeFolders

Optional

Exclude specific folders from the export.

-ContentFilter

Optional

Filter to export only specific items. E.g. {Received -gt "01/01/2024"}.

-IsArchive

Optional

Switch to export the personal archive instead of the primary mailbox.

Common Usage Scenarios (with Examples)

Exporting a mailbox using this command can be used for various reasons. Let’s list a few common ones:

  • A user leaving the company and you want to keep a copy before removing the mailbox from the server.
  • Archiving data and removing from the server due to compliance and regulations.
  • Migrating to another system or server.
  • Exporting data from merged or decommissioned environments.

Scenario 1 – Export a Single Mailbox to PST

A single mailbox can be exported by using the below command.

New-MailboxExportRequest -Mailbox "<username to export>" -FilePath "<full UNC Path with file>"

Export a Single Mailbox to PST

Scenario 2 – Export a Specific Folder Only

For this, you have to use the -IncludeFolders parameter with the command (see below).

New-MailboxExportRequest -Mailbox "<username to export>" -FilePath "<full UNC Path with file>" -IncludeFolders "<folder>"

Export a Specific Folder Only

For exporting multiple folders in a mailbox, you can mention the folders’ name and separate them with commas (see the below command).

New-MailboxExportRequest -Mailbox "<username to export>" -FilePath "<full UNC Path with file>" -IncludeFolders "<folder>","<folder>"

exporting multiple folders in a mailbox

Note: You can only export #Inbox#, #SentItems#, #DeletedItems#, #Drafts#, #Calendar#, and #Contacts# folders.

Scenario 3 – Export Emails Received after a Specific Date

For this, you need to use the ContentFilter parameter with the Received condition by specifying the starting day, month, and year (see the below example).

New-MailboxExportRequest -Mailbox "<username to export>" -FilePath "<full UNC Path with file>" -ContentFilter {Received -gt "<yyyy-mm-dd>"}

Export Emails Received after a Specific Date

Scenario 4 — Export Personal Archive Mailbox

You can use the command with the -IsArchive parameter, if you want to export only a user archive (see below).

New-MailboxExportRequest -Mailbox "<username to export>" -FilePath "<full UNC Path with file>" -IsArchive

Export Personal Archive Mailbox

Scenario 5 — Export with Bad Item Limit (Corrupt Mailboxes)

For exporting a mailbox with bad items or corrupt items, you can add the BadItemLimit parameter at the end of the command, along with AcceptLargeDataLoss. This is required when having a count of over 50.

New-MailboxExportRequest -Mailbox "<username to export>" -FilePath "<full UNC Path with file>" -BadItemLimit <total number> -AcceptLargeDataLoss

Export with Bad Item Limit

Scenario 6 — Export Multiple Mailboxes in Bulk

You can use a CSV file (specifying the mailboxes) and file path with the command and PowerShell loop for exporting multiple mailboxes.

Here is an example of the CSV file:

Mailbox,FilePath
user1@mycompany.lan,\\ex01\PSTExports\user1.pst
user2@mycompany.lan,\\ex01\PSTExports\user2.pst
user3@mycompany.lan,\\ex01\PSTExports\user3.pst

Once the file is populated, run this command.

Import-Csv "<location of csv file>" | ForEach-Object {New-MailboxExportRequest -Mailbox $_.Mailbox -FilePath $_.FilePath}

Export Multiple Mailboxes in Bulk

For exporting all the mailboxes, you can use the below-given script.

Get-Mailbox -Database "<database>" | ForEach-Object {
$alias = $_.Alias
New-MailboxExportRequest -Mailbox $_.Alias -FilePath "<\\server\share>\$alias.pst"}

This will export all the mailboxes and create PST files based on the aliases of users.

How to Check Export Request Status?

You have to use the command - Get-MailboxExportRequest to get the status of all export requests. If you want to see the status of a specific mailbox, use the command with the -Mailbox parameter (see the below example).

Get-MailboxExportRequest -Mailbox "<email address>

Check Export Request Status

It will display the status as InProgress, Success, Failed, or Suspended. Let’s see their specific meaning.

 

Status

Meaning

Action needed

Queued

Request created and waiting to start

No action needed — will start automatically

InProgress

Export is running

Monitor with Get-MailboxExportRequestStatistics command

Completed

Export finished successfully

Remove the request with Remove-MailboxExportRequest command

Failed

Export failed due to an error

Check error with Get-MailboxExportRequestStatistics | fl * command

Suspended

Export was manually suspended

Resume with Set-MailboxExportRequest -Status InProgress or Resume-MailboxExportRequest command

You can run the Get-MailboxExportRequest command with the Get-MailboxExportRequestStatistics command to see the percentage status of the export (see the below example).

Get-MailboxExportRequest -Mailbox "<mailbox name>" | Get-MailboxExportRequestStatistics

percentage status of the export

To know the mailbox statistics of a specific user, use the below command.

Get-MailboxExportRequestStatistics -Identity "<export name>" | fl PercentComplete,Status,Message

mailbox statistics of a specific user

Video demonstration to Export Exchange Mailbox to PST Using New-MailboxExportRequest  

Common Errors and Fixes

Let’s have a look at some issues that you might face and the solutions to fix them.

 

Error

Cause

Fix

The term New-MailboxExportRequest is not recognized

Mailbox Import Export role is not assigned

Assign the role by using New-ManagementRoleAssignment -Role "Mailbox Import Export" -User "admin"

Error: Cannot open file because it is being used by another process

Another export request is writing to the same PST file

Use a unique -Name parameter or different -FilePath for each export

Error: The file path must be a UNC path

Using a local path (C:\) instead of a network share

Change -FilePath to a UNC path: \\server\share\export.pst

Export stuck in Queued status for a long time

MRS service stopped or overloaded

Restart-Service MSExchangeMailboxReplication

Export fails with BadItemCount exceeded

Mailbox contains more corrupt items than -BadItemLimit allows

Increase -BadItemLimit and add –AcceptLargeDataLoss

What are the Challenges and Limitations of Above Process?

Here are some challenges you may face while exporting the mailboxes using the above command:

  • The Exchange Server must be running and accessible.
  • It only works if the database is mounted and accessible.
  • Requires scripting and you can make a mistake.
  • Doesn’t work on public folders, deleted items, or disabled mailboxes.
  • It can get complex when filtering.
  • Running multiple exports can degrade the server’s performance.

Additionally, if the Exchange Server is not working, the database is not mounted, or there are issues with the server, you are not able to export the mailboxes. In such situations, you have to take then help of Stellar Converter for EDB - a specialized EDB to PST converter tool. You can open database - be it live or offline - from any version of Exchange Server and without any size limit. It allows you to save user mailboxes, user archives, shared mailboxes, disabled mailboxes, and public folders to PST and other file formats. There is also an option to export the mailboxes to a live Exchange Server or an Office 365 (Microsoft 365) tenant with automatic mailbox matching.

Conclusion

In this guide, we have explained how to export mailboxes to PST by using the command - New-MailboxExportRequest. The native command is best for a one-time export job or to export one mailbox at a time. You can use EDB to PST converter tool, like Stellar Converter for EDB to export multiple mailboxes to PST at a time. You can also export public folders and disabled mailboxes with this tool.



Was this article helpful?
FAQs
This command exports a mailbox or archive to PST file. The PST file is exported to a UNC path.
This is typically happened when the Mailbox Import/Export role is not assigned to the user.
No, the command only works with a network share (UNC Path). This can be shared on the same server or another server/storage in the network.
You can use the Get-MailboxExportRequest command. To see a specific export request, use the –Mailbox parameter with the command.
The command itself doesn’t give the facility to do so. You should use a CSV file to populate the mailboxes and then use a loop in PowerShell to initiate the bulk export.
This command is only available in on-premises servers. In Exchange Online, you have to use Microsoft Purview (Content Search) feature.
You can export specific folders by using the -IncludeFolders parameter wth New-MailboxExportRequest command.
You must give full control permission to the user doing the export and to the Exchange Trusted Subsystem.
This depends a lot on the Exchange Server performance at the point in time, the compute resources assigned to the server, and the performance of the storage on the destination server.
To remove the completed or failed exports, you should use the Remove-MailboxExportRequest as these are not deleted or purged automatically.
About The Author
author image
Shelly Bhardwaj linkdin Icon

Shelly is technology expert and core knowledge of Exchange Server, Outlook.

WHY STELLAR® IS GLOBAL LEADER

Why Choose Stellar?
  • 0M+

    Customers

  • 0+

    Years of Excellence

  • 0+

    R&D Engineers

  • 0+

    Countries

  • 0+

    PARTNERS

  • 0+

    Awards Received

BitRaser With 30 Years of Excellence
Technology You Can Trust
Data Care Experts since 1993
google-trust
×