New-MailboxExportRequest Error: Header File Length is Zero – [SOLVED]
The export of mailboxes is routing job for Exchange Administrator. However, moving mailboxes using PowerShell cmdlet can cause or arise some issues. At times, the command fails with error displaying below:
When you analyse the error, you will notice that it will not arise for all mailboxes but mostly mailboxes of large size. It occurs when exporting all mailboxes into PST by utilizing ForEach PowerShell command. The method is suggested for few mailboxes. If you look this solution for large number of mailboxes, it will hamper the server performance. Thus, before running the below command, ensure to check storage and requirements.
ForEach ($m in (Get-Mailbox –ResultSize Unlimited)) {(New-MailboxExportRequest –Mailbox $m –FilePath “\\EX01\pst_exports\$($m.Alias).pst”}.
Running the command for first time will work fine, but for another run, one will get an error message. If these fails, one need to get rid of failed requests. To view mailbox export request on server, execute the command Get-MailboxExportRequest to access all request which runs on the server. To remove the request, use Remove-MailboxExportRequest PowerShell cmdlet. The command requires more parameters, but to clean the server, run following command:
Run below command to remove all successful requests:
Get-MailboxExportRequest –Status Completed | Remove-MailboxExportRequest
Run below command to remove all failed requests:
Get-MailboxExportRequest –Status Failed | Remove-MailboxExportRequest
One need to fix the problem as Exchange unable to remove export requests automatically. Still, if it fails, one can look statistics of detailed report which can be extracted using below command:
Get-MailboxExportRequest | Get-MailboxExportRequestStatitics –IncludeReport
Now, check Exchange Replication Service, if it is working well on Client Server Access (CAS). The test ensures that replication service is responding to RPC i.e. Remote Procedure Call. Running below command will ensure connectivity test.
Moreover, do not perform the test via Exchange Management Console (EMC) but it should run on Client Access Servers using PowerShell. In case of having more than one Client Access Servers, one is required to perform the test on all servers by using below command:
Get-ClientAccessServer | Test-MRSHealth
To check Exchange Replication Service on particular Client Access Server, one should run below command and provide identity i.e. name of server.
Test-MRSHealth –Identity EXC-CAC-001
By utilizing same command, one can get full report that include monitoring events, performance counters in the end. The result exported in XML file type at specified location. It will give clear indication when service is executing normally.
Test-MRSHealth –Identity EXC –CAS-001 –MonitoringContext $true | Export-CliXml “C:\Scripts\ExchangeReports\EXC-CAS-001P_MRSHealth.xml”
If it is not a case, first delete PST files created from failed requests and run the command Get-MailboxExportRequest again. Although, it can be workaround to the issue, one will end up with more administrative work on hand when trying to get failed request and again run the export request again on particular mailboxes.
If all request fails, then make use of Exchange Migration Tool. It is a professional, secure and cost-effective utility that easily fix all the issues and allows to migrate Exchange to PST, Exchange and Office 365 with all mailbox items without any data loss. It proves best alternative method to New-MailboxExportRequest PowerShell Command.
The software is installable on all versions of Windows OS including Win 10. But with this, make sure that Windows having Exchange Server for successful process. The entire process requires minimal user effort and time. The application equipped with plethora of features that one can use for desired migration. Moreover, it is executable by all professional, novice users and any organization. To check the process, try the free demo version that allows to move first 25 files from Exchange to PST and other formats/accounts free of cost.