Cannot remove MailboxExportRequests

remove MailboxExportRequests

How to remove MailboxExportRequests after you get an error Value cannot be null.

This will be a short one Cannot remove MailboxExportRequests

Here we go :

Scenario  :

Already triggered MailboxExportRequests cannot be removed with piping the common powershell syntax Remove-MailboxExportRequest.

We saw this problem first after we had CU6 in place.

When you try to remove MailboxExportRequests with the following command you get the error below as a result :

Get-MailboxExportRequest -Status (Whatever you need: Completed, Failed, Suspended, InProgress) | Remove-MailboxExportRequest

WARNING: An unexpected error has occurred and a Watson dump is being generated: Value cannot be null.
Parameter name: index
Remove-MailboxExportRequest : Value cannot be null.

Solution :

Pipe the Remove-MailboxExportRequest command as follows :

Get-MailboxExportRequest -Status completed | %{Remove-MailboxExportRequest $_.RequestGuid -Confirm:$false}

Change -Status to Queued to remove queued MailboxExportRequests
… or change the -Status switch to your needs.

Leave the -Status switch away to remove all MailboxExportRequests

 

Update:

After installing Exchange 2016 CU8 the classic way to remove  MailboxExportRequests seems to work again.

Get-MailboxExportRequest -Status (Whatever you need: Completed, Failed, Suspended, InProgress) | Remove-MailboxExportRequest

That’s it !

Have a nice day 🙂

Leave a Reply

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