How to Resolve “New-MailboxExportRequest Error: Header file length is zero”

Summary: New-MailboxExportRequest PowerShell cmdlet helps admins export single or multiple mailboxes to PST format. But sometimes, when you try to export multiple or large mailboxes at once, you may encounter the “New-MailboxExportRequest Error: Header file length is zero.” In this article, you will learn methods to resolve the error and export multiple mailboxes to PST. You can also use an EDB to PST converter tool to avoid errors and export single or multiple mailboxes to PST without any limitations.

Exporting mailboxes is a routine job of an Exchange Administrator. When exporting mailboxes with the PowerShell cmdlet, you might encounter some issues. At times, it fails with the below error.

Unable to open PST file ‘EX01\pst_exports\user01.pst’Error details: Header file length is zero, is the file is from a previously failed PST export, please delete the file and resume the export.

After analyzing, you might notice that it?s not with all the mailboxes but mostly with large mailboxes, exceeding 1 GB in size. This occurs when you export all the mailboxes to PST, using the ForEach PowerShell method. This method is only recommended for a small number of mailboxes. If you launch this for a large number of mailboxes, it may cause performance issues on the server. So, before running the below command, make sure to check the requirements and storage. The command is as follows:

ForEach ($m in (Get-Mailbox -ResultSize Unlimited)) {New-MailboxExportRequest -Mailbox $m -FilePath "\\EX01\pst_exports\$($m.Alias).pst" }.

The first run will work fine, but when you execute the command for another run, you may get the above error message. If these are failed, you need to remove the failed requests. To see the mailbox export requests on your server, run the command Get-MailboxExportRequest to get all the requests that have been executed on the server. To remove the request, you need to use the Remove-MailboxExportRequest PowerShell cmdlet. By itself, the command does need more parameters, but to clean up the server, you need to run the following commands.

To remove all successful requests, you need to use the below-given command:

Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequest

To remove all the failed requests, you need to use the below given command:

Get-MailboxExportRequest -Status Failed | Remove-MailboxExportRequest

Usually, this should fix the problem. Exchange does not remove the export requests automatically. If this still fails, you can look into the detailed report statistics that can be extracted with the command below.

Get-MailboxExportRequest |Get-MailboxExportRequestStatistics ?IncludeReport

Another option is to check the Exchange Replication Service, if itis running and functioning well on your Client Access Server (CAS). This test will ensure that the replication service is responding to a remote procedure call (RPC). The below procedure will ensure to test this connectivity.

This test cannot be done through Exchange Management Console (EMC) but must be executed on Client Access Servers with PowerShell. If you have multiple Client Access Servers, you would need to conduct test on all servers, by running the below command.

Get-ClientAccessServer | Test-MRSHealth

To test Exchange Replication Service on a specific Client Access Server, you must run the command below and specify the Identity (name of the server).

Test-MRSHealth ?Identity EXC-CAS-001

With the same command, you can get a full report that also includes monitoring events, and performance counters in the result. The results are exported in XML file format to your location. This will give you a clear indication that the service is running normally.

Test-MRSHealth -Identity EXC-CAS-001 -MonitoringContext $true | Export-CliXml "C:\Scripts\ExchangeReports\EXC-CAS-001_MRSHealth.xml"

If this is not the case, you can first delete the PST files of the failed requests and try the PowerShell cmdlet Get-MailboxExportRequest command again. Although this could be a workaround to the problem, you will end up with more administrative work on your hands while trying to get the ones that failed and re-run the export request again on those specific mailboxes.
If all this fails, you might want to look at a third-party EDB to PST Converter software since the native tools that come with Exchange Server do not offer the solution. Stellar Converter for EDB software can help in such cases. It is the best alternative method to the New-MailboxExportRequest PowerShell cmdlet.

The software can be installed on a Windows Server or a Windows 10 machine with minimal effort or complex configuration. It can open any database format or version of Exchange Server from 5.5 to Exchange Server 2019. You can make a granular export to PST and other formats like EML. The application also serves as a migration tool where you can export all or selected mailboxes to a live Exchange Server database or Office 365.

Related Post