Microsoft introduced the New-MailboxExportRequest cmdlet for administrators to export mailboxes in the Exchange server database to PST format for backup or migration purposes. These PST files can then be imported to another Exchange server or Outlook.
However, sometimes the command may fail and you get an error message due to any of the following issues:
- The cmdlet has wrong parameters or switches or the command syntax is wrong.
- You do not have the required roles and permissions assigned. .
- Mailbox has Bad Items.
- Mailbox has Large Items.
Let us now look at the methods to resolve the issues with New-MailboxExportRequest command.
Methods to Fix Issues with the New-MailboxExportRequest command
Depending upon the reason why the command failed, use the following methods to fix the issue with New-MailboxExportRequest command.
Method 1- Assign the Mailbox Import Export Role to the user account.
To ensure data security while exporting or importing mailboxes, Microsoft has implemented role-based access control. This requires administrators to be assigned the Mailbox Import Export role before using this cmdlet. By default, this role is not assigned to any user account.
If you are running this command without the Mailbox Import Export role, you will get the following error:
Assign the Mailbox Import Export Role to your account using the New-ManagementRoleAssignment cmdlet.
Verify if the role has been assigned, by using the Get-ManagementAssignment cmdlet.
Once you have verified that the Mailbox Import Export role is successfully assigned, run the New-MailboxExportRequest command again. If the request fails, use the following method to resolve the issue.
Method 2- Verify if you have entered the correct parameters and switches in the command
The New-MailboxExportRequest cmdlet is used with multiple parameters and switches that are used to filter out the mailbox items to be exported to PST. For example, in the code displayed below, ContentFilter switch is used.
New-MailboxExportRequest -Mailbox Anubhuti -ContentFilter “(Body -like ‘*company*’) -and (body -like ‘*profit*’) -and (Received -lt ’01/01/2024′)” -FilePath \\SERVER01\PSTFileShare\Tony_CompanyProfits.pst
This command exports messages that contain the words “company” and “profit” in the body of the message for the user Anubhuti received before January 1, 2024.
If any of the parameters is entered incorrectly, the command will fail.
Additionally the path for the destination of PST file should be written using the UNC. If there is any error in the naming convention of the path, the command will fail with the following error:
To prevent the command failure due to incorrect parameters or UNC path, ensure, you are entering the parameters correctly and the path is in the following format:
“\\Server name\Folder Name\File Name”
Method 3 – Set a large Item Limit in the command
The New-MailboxExportRequest will fail if there are large items in the target mailbox. A large item is a message in the source mailbox that exceeds the maximum message size that’s allowed in the target mailbox. To check is this is the reason for the failure, run the Get-MailboxExportRequest cmdlet and check the LargeItemsEncountered field.
To avoid this issue, you can use the LargeItemLimit parameter to specify the the maximum number of large items that are allowed before the request fails. Follow the syntax given below to set the large item limit with the export request.
Get-MailboxExportRequest <identity> | Set-MailboxExportRequest –Largeitemlimit <input value>
Resume-MailboxExportRequest <identity>
Note: If you set the input value greater than 51 you need to use AcceptLargeDataLoss swith with the request otherwise the request will fail. Use the syntax displayed below:
Method 4 – Set a Bad Item Limit in the command
The New-MailboxExportRequest will fail if there are corrupted or missing items in the target mailbox. To check is this is the reason for the failure, run the Get-MailboxExportRequest cmdlet and check the BadItemsEncountered field.
To avoid this issue, you can use the BadItemLimit parameter to specify the the maximum number of bad items that are allowed before the request fails.
Get-MailboxExportRequest <identity> | Set-MailboxExportRequest –baditemlimit <input value>
Resume-MailboxExportRequest <identity>
Note: In Exchange 2010, if you set the Baditemlimit parameter value to 51 or higher, you also need to use the AcceptLargeDataLoss switch. Otherwise, the command will fail.
Alternative method to Export Mailboxes to PST
It is recommended to use professional EDB to PST converter tools like Stellar Converter for EDB to convert the mailboxes in Exchange database to PST format. This application scans Online and Offline Exchange databases (EDB) to extract data form the mailboxes and then convert it into PST files. The exported PST files can be directly exported to Live Exchange or Microsoft 365. The data extracted from the EDB files can be saved in different formats like HTML, EML, and MSG. Additionally you can also use the software to export Public Folders to PST. You don’t need any additional permissions. You can also connect to an online EDB database without dismounting the database from Exchange. The software supports all versions of Exchange Server – from Exchange 5.5 to 2019, allowing you to export mailboxes from both old and new Exchange servers.
To Sum Up
The New-MailboxExportRequest cmdlet, used to export mailboxes in the Exchange database to PST. This command may fail sometimes due to issues with user roles, command syntax, mailbox item corruption or large size of the mailbox item. Above, we have explained various methods to resolve the issues that may cause the command to fail. However, these methods are time consuming and sometimes may even result in data loss. It is recommended to use a third party tools like Stellar Converter for EDB to export data in the mailbox to PST without data loss.