Hello folks, Today I would like to share my experience so far on how to export a mailbox with New-MailboxExportRequest. There are a couple of parameters to query to get useful information about the status of an export request.
As long as everything goes smooth you will probably just need the percentage information. But when the New-MailboxExportRequest stalls or stops with an error you will be happy to have some additional parameters to query at your disposal.
So let’s get to the point straight away:
Start to export a mailbox with New-MailboxExportRequest:
Use the -Priority switch with Emergency to prevent stalling!
After you have started the export request check the progress:
As a result, you will get the values of the selected parameters.
Adjust the selected parameters if the output gets too long or intransparent.
For example remove -IncludeReport
You can find a description of the selected parameters below.
First, a short info on the -IncludeReport switch:
New-MailboxExportRequest relevant infos that can be selected:
Name: The individual name of the mailbox export request.
Priority: Possible values are Lower, Low, Normal (This is the default value), High, Higher, Highest, Emergency [Use the highest priority to prevent stalling. I usually use Emergency]
FailureCode: Displays the failure code [ not really useful unless you find a list of failure codes for export requests. I couldn’t find one.]
FailureType: Description of the failure that stopped the mailbox export request.
DiagnosticInfo: This needs to be used with the -Diagnostic switch when selected to display diagnostic information. Among others, you will be able to see job pickup results and timestamps.
BadItemLimit: The max. amount of inconsistent items that will be skipped and will not be exported. When this limit is reached the export will fail. A BadItemLimit greater than 50 requires the -AcceptLargeDataLoss switch.
BadItemsEncountered: Number of bad items found during the export.
LargeItemLimit: The max. amount of items in the mailbox that exceeds the allowed message size. The default value is 0. A value higher than 50 requires the -AcceptLargeDataLoss switch. (not recommended)
LargeItemsEcountered: Number of large items found during the export.
OverallDuration: Duration of the mailbox export. Includes times of stalling as well.
Status: The current state of the export. Relevant values are inProgress, Queued, Completed, Failed, Suspended.
StatusDetail: Displays additional information on some states.
EstimatedTransferSize: Estimates and displays the amount of the exported data.
BytesTransferred: Displays the amount of data that has been really transferred. This usually differs from the EstimatedTransferSize.
EstimatedTransferItemCount: Estimates and displays the number of items that will be transferred.
ItemsTransferred: Displays the number of items that have been transferred. Can differ from EstimatedTransferItemCount. ( Among others depending on encountered bad or large items and the associated limits )
PercentComplete: The progress of the export request in percent.
Modify parameters of a mailbox export request:
To modify the parameters of an existing mailbox export request you will need to suspend the request first. This can be useful when you retrospectively want to change the BadItemnLimit or want to raise the priority.
Suspend the mailbox export request:
In case you want to suspend all mailbox exports of the same batch:
Now change the parameters [Example: BadItemLimit]
In order to change all export requests of the same batch:
Resume the mailbox export request:
In case you want to resume all mailbox exports of the same batch:
Modifying the BadItemLimit value makes sense when you have started the export with a low BadItemLimit ( for exmaple 5 ). While monitoring the export you assume that there will be more bad item than you have specified.
Another case would be when the export fails because the BadItemLimit threshold has been reached. In that case, you can modify the BadItemLimit after the export failed and resume the export. Suspend is not needed here as it has already failed. To be honest I usually trigger a New-MailboxExportRequest when this happens because I don’t trust the resume. I am not 100 percent sure that the resume picks up where it stopped and I want to prevent duplicated items. But if you trust the resume process more than me give it a try.
Here are two arguments to remove mailbox export requests you don’t need anymore:
- To export a mailbox with New-MailboxExportRequest with the same request name.
- Further, do some housekeeping and keep your environment clean and transparent.
In case you want to remove all mailbox exports of the same batch:
In order to remove all mailbox export requests:
Get-mailboxExportRequest vs. Get-MailboxExportRequestStatistics:
Whenever an export request got stalled and I monitored the request with Get-MailboxExportRequest it showed me InProgress as the current state.
Only Get-mailboxExportRequest | Get-MailboxExportRequestStatistics showed me the real status.
It seems regarding the state of the export Get-mailboxExportRequest is not as much reliable as Get-MailboxExportRequestStatistics.
For this reason I always use Get-MailboxExportRequestStatistics when I export a mailbox with New-MailboxExportRequest.
Have a nice day!