New MailboxExportRequest Error Header File Length Is Zero | How to Solve it
Exporting the mailbox into Outlook Data File by using Exchange Management Shell for an IT administrator and Exchange users is a piece of cake. But when they try to export all the mailboxes to PST by using the command given in the below section they have to face this error “new mailboxexportrequest error header file length is zero”.
foreach ($n in (Get-Mailbox -ResultSize Unlimited)) { New-MailboxExportRequest -Mailbox $n -FilePath “\\PC\New Folder\$($n.Alias).pst” }.
Note: “\\PC\New Folder\$($n.Alias).pst” It is the UNC path.
Error Occurred After Executing the Above Command
Unable to open PST file ‘\\PC\New Folder\admin.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
How to Fix “new mailboxexportrequest error header file length is zero”?
You need to remove the failed requests. For this users have to insert the given command in the Exchange Powershell:
Get-MailboxExportRequest -Status Failed | Remove-MailboxExportRequest
Command to remove all Completed Request
Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequest
If a user wants to see all the request which is executed on the Exchange Server. Follow this command:
Note: This command will provide the complete list of all Completed and Failed requests.
Get-MailboxExportRequest
The export request cannot remove automatically in the Exchange. That’s why users perform these commands, which helps them to clean up the server. Then users have to check the complete report statistics. Follow the given command:
Get-MailboxExportRequest |Get-MailboxExportRequestStatistics –IncludeReport
Check whether the Exchange Mailbox Replication Service is functioning and running well on CAS (Client Access Server). It will ensure the users that this service is responding to the RPC (Remote Procedure Call).
Users have to execute the command on Client Access Server with Exchange PowerShell. If one has multiple CAS, then they have to perform this test on all servers by using this command
Get-ClientAccessServer | Test-MRSHealth
Command to test Mailbox Replication Service on a particular CAS. Users will get the full report by executing this command and they can see that service is running normally or not.
Test-MRSHealth –Identity MB02
Where MB02 is the name of the Server
If all this fails, then users have to delete the PST file. Users can restart the Exchange Replication Service on the CAS server if they are unable to delete the Outlook Data File. Then the user have to modify the export request command by adding this: -BadItemLimit 10000 -AcceptLargeDataLoss
For example: New-MailboxExportRequest -Mailbox “Mailbox name” -BadItemLimit 10000 -AcceptLargeDataLoss -FilePath \\PC\New Folder\sourcefilename.pst
This command helps the users to export huge Mailboxes with all the corruption include with it.
Users can try the alternative method to export all mailboxes of any size into PST by using the advanced software i.e. SysTools EDB to PST Converter tool. It also recovers highly corrupted Exchange database files and repair Exchange mailbox.
This utility allows the user to load offline/dismounted Exchange Database File. Users can use the software to extract mailbox from EDB file Exchange 2016/2013 and export to PST files and other various file formats (HTML, MSG, MBOX, EML, PDF) in a single shot.
It is the professional solution that is used by the Exchange and Naive users. Users can preview Exchange Mailbox data items such as emails, calendars, notes, tasks, journals, contacts. The software supports all Exchange Server versions.
The automated software provides dual scan option i.e. (Quick and Advance scan) which easily resolves the database corruption Exchange 2010, 2013, 2016 without any data loss. Depending on the level of corrupted offline Exchange database file user can select the scan mode option and repair EDB file and mailboxes easily.
Also, the advance scanning option automatically recover purged mailbox and data items from the loaded Exchange database file. If user want to recover deleted mailbox after retention period then they can select this option and recover the Exchange database mailboxes with no data loss.
Step by Step Working Of Automated Tool
Step 1: Download > Launch the software
Step 2: Click on Add File button and load EDB file > Click on Add
Step 3: Preview all Exchange Database File / Mailboxes / Data items > Click Export
Step 4: Select all the Exchange Mailboxes > Click on PST format > Click on browse to set target location > Click Export
Finally, the user has exported all the Exchange Mailboxes
Bringing It All Together
This write-up provides the complete solution to fix “new mailboxexportrequest error header file length is zero” by using a manual and automated solution. However, the manual solution cannot be performed by everyone because it requires technical skills and understanding of Exchange PowerShell commands or error. The professional solution described above is the best approach to export all the mailboxes of any size into PST without any data loss.