Apps

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

EDB to PST converter tool

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.

  • CategoryInfo: NotSpecified: (0:Int32) [New-MailboxExportRequest], RemotePermanentException
  • FullyQualifiedErrorId: 97E980C,Microsoft.Exchange.Management.RecipientTasks.NewMailboxExportRequest

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.

Mailbox Export Step-by-Step Resolution

Mailbox Export Step-by-Step Resolution

1. Remove Failed or Completed Export Requests

Use the following PowerShell commands to remove old or failed export requests:

  • Remove Completed Requests

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

Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequest

  • Remove Failed Requests

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

Get-MailboxExportRequest -Status Failed | Remove-MailboxExportRequest

2. Review Export Request Statistics

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

Validate the Exchange Replication Service

Another option is to check the Exchange Replication Service, if it is 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.

Conclusion

The “Header file length is zero” error usually occur from attempting bulk mailbox exports without proper cleanup of failed export requests or due to resource constraints. While PowerShell provides some means to recover, manual intervention or use of a third-party EDB to PST converter tool like Stellar Converter for EDB offers a more efficient and reliable solution—especially for large environments or time-sensitive operations.

Max Schiller (Tech Apps Reviews)

About Max Schiller (Tech Apps Reviews)

An online privacy enthusiast, Max approaches they writing about tech with an "I can help!" attitude. With particular interest in cyber hygiene, he strives to share practical insights with Tech Apps Review readers.

Leave a Reply

Your email address will not be published. Required fields are marked *