EDB to PST Converter

How to Use Remove-MailboxExportRequest Cmdlet in Exchange Server (Complete Guide)

info-icon Our content follows trusted Editorial Standards - accurate & unbiased.

Summary: In Exchange Server, the command - Remove-MailboxExportRequest - is used to remove completed, failed, or suspended export requests. It does not delete the exported PST files. As the export requests are not removed automatically, this prevents the list from increasing and slowing down the Get-MailboxExportRequest queries.

Table of Contents

The Remove-MailboxExportRequest cmdlet in PowerShell completely removes the export requests – be it failed, completed, or partially completed – which were created by the New-MailboxExportRequest. It doesn’t remove the actual exported PST files. It only removes the requests’ record from the Exchange Server as these are not automatically removed from the Exchange Server. This article covers when and how to use Remove-MailboxExportRequest and best-practice cleanup schedules. It also covers some common errors, along with their fixes.

What Does Remove-MailboxExportRequest Command Do?

This command will cleanup and remove the export request commands executed on the server. Once you have completed the exports, be it failed export, suspended, or completed with errors, it’s best practice to clean up the requests.

You cannot remove an in-progress export request without suspending it first. For this, use the below command:

Suspend-MailboxExportRequest -Identity "<mailbox name>\MailboxExport"
Remove-MailboxExportRequest Command

If you fail to do so, you will get an error message and the export request will not be removed or stopped.

The command will remove the record from the Exchange Server. So, the completed, failed, or completed with errors, requests are removed from the list. Otherwise, the accumulated requests will slow down the Get-MailboxExportRequest queries while taking a considerable amount of time. You will benefit from a cleaner Exchange Server and easier manageability of the new exports. Although the record of the export in the Exchange Server is removed, the PST file will not be deleted.

Note: If you re-run the export of a removed request, you will need to change the PST destination file or rename the already exported file.

ScenarioWhat Remove-MailboxExportRequest doesPST file affected?
Remove after Completed statusRemoves the completed request record from ExchangeNo — PST remains at UNC path
Remove a Failed requestClears the failed request so you can create a new oneNo — partial PST remains if any
Remove while InProgressStops the export and removes the requestNo — partial PST remains at UNC path
Bulk remove all CompletedRemoves all completed request records in one commandNo — all PST files remain

Prerequisites

To run the command, you will need specific role, i.e. Mailbox Import Export, in the Exchange Server. It is the same if you need to run the New-MailboxExportRequest command. To assign the role,

  • Open a PowerShell window in the Exchange Management Shell (EMS).
  • Run the command as given below:
New-ManagementRoleAssignment -Role "Mailbox Import Export" -User username
New-MailboxExportRequest command

This will assign the role to the specified user.

However, the best practice is assign the role to a security group.

New-ManagementRoleAssignment -Role "Mailbox Import Export" -SecurityGroup "<group name>"
best practice is assign the role to a security group

Once the command is executed, close the EMS and and re-open it. Then, run the Remove-MailboxExportRequest command.

Note: The Mailbox Import Export role is not assigned by default to any user, not even to the Organization Management admins.

Syntax and Parameters

The command’s full syntax is:

Remove-MailboxExportRequest [-Identity] <MailboxExportRequestIdParameter> [-Force] [-Confirm] [-WhatIf]

Here is a list of all parameter, along with the requirements and description.

ParameterRequirementDescription
-IdentityRequired (or pipeline)The name of the export request in Mailbox\RequestName format. For example, john.doe\MailboxExport.
-ForceOptionalForces removal without confirmation prompt. Use carefully in scripts.
-ConfirmOptionalPrompts for confirmation before removing each request. Default behavior.
-WhatIfOptionalShows what would happen without actually removing anything. Recommended for bulk removals before execution.

It can also be used in combination with other commands (see the example below).

Get-MailboxExportRequest [filters] | Remove-MailboxExportRequest

Common Scenarios to Use the Command

You can use the -WhatIf parameter to see what the command will do before actually running it.

WhatIf parameter to see what the command

This will also give information on which requests would be removed.

Let’s take a look at some scenarios where you can use this command:

Scenario 1 – Remove a Single Completed Export Request

To remove a single export request, you should use the command as given below.

Remove-MailboxExportRequest -Identity <identity of export>
Remove a Single Completed Export Request

If you’re not aware of the identity, you can use the command – Get-MailboxExportRequest. This will give you the list of all the export requests.

Scenario 2 — Remove All Completed Export Requests (Bulk Cleanup)

You can use the command with Get-MailboxExportRequest to bulk remove the requests.

Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequest
Remove All Completed Export Requests

Scenario 3 — Remove All Failed Export Requests

For this, you will need to use the command as given below.

Get-MailboxExportRequest -Status Failed | Remove-MailboxExportRequest
Remove All Failed Export Requests

Scenario 4 — Remove All Export Requests Regardless of Status

You can use the following command to get all the requests and remove them. This will them all without prompting.

Get-MailboxExportRequest | Remove-MailboxExportRequest
Remove All Export Requests Regardless of Status

If you want a prompt before removing each request, you need to add the -Confirm switch in the command.

Get-MailboxExportRequest | Remove-MailboxExportRequest -Confirm:$false
add the -Confirm switch in the command

Scenario 5 — Remove Requests Older than a Specific Date

You have to first specify the cut-off date (by using the line below) to define the variable.

$cutoff = Get-Date "<YYYY-MM-DD>"

If the completed data is earlier than the specified date, use the below command to remove the requests:

Get-MailboxExportRequest -Status Completed | Where-Object { $_.CompletionTimestamp -lt $cutoff } | Remove-MailboxExportRequest -Confirm:$false
Remove Requests Older than a Specific Date

Common Errors and Fixes

ErrorCauseFix
The operation could not be performed because object could not be foundThe request name or mailbox identity is wrongRun Get-MailboxExportRequest without filters to list all requests and verify the exact identity
The term Remove-MailboxExportRequest is not recognizedMailbox Import Export role is not assignedAssign the Mailbox Import Export role and reopen EMS
Cannot remove a request with status InProgress without -ForceTrying to remove an active export requestAdd -Force parameter or wait for the export request to complete first
Access deniedInsufficient permissions on the request or mailboxEnsure the account has Mailbox Import Export role and the request was created by the same or a delegated account
Export request removed but PST file is missing / incompletePartial export was removed before completionRe-run New-MailboxExportRequest with the same or new file path
PST export failed repeatedly and mailbox data is needed urgentlyExchange database issue preventing MRS from completing the exportUse Stellar Converter for EDB to extract mailbox data directly from the EDB file, bypassing the export request system entirely. This is particularly useful when Remove-MailboxExportRequest is needed to clear stuck exports but the data still hasn’t been recovered.

Running a cleanup schedule prevents export request accumulation and keeps Get-MailboxExportRequest queries fast. Below is a matrix of what you can do for scheduling of running the command.

FrequencyRecommended CommandPurpose
Daily (if bulk exports run)Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequestRemove completed requests from previous day
WeeklyGet-MailboxExportRequest -Status Failed | Remove-MailboxExportRequestClear failed requests before retrying
MonthlyGet-MailboxExportRequest | Where-Object {$_.CompletionTimestamp -lt (Get-Date).AddDays(-30)} | Remove-MailboxExportRequestRemove old completed requests
Ad hocGet-MailboxExportRequest | flFull audit of all current export requests

Frequently Asked Questions

The command will remove the record of the export request from the Exchange Server which would have accumulated over time.
No, the PST file is not deleted with this command as it will only remove the request from the server.
Accumulated export requests can degrade the execution of the command and the log will consume more storage.
It is not possible to stop and remove an in-progress export request. You need to suspend it using the Suspend-MailboxExportRequest command before removing such a request.
Removing the export request does not affect the PST file. If the database is offline, the request may not be successful or failed get. As an alternative, use Stellar Converter for EDB. It will extract the mailbox data directly from the EDB file.
The PST file will be partial and not usable. It can be discarded and you should rerun the export again.
You should use the Get-MailboxExportRequest command. It will list all the requests.
No. This command is compatible with Exchange Online. It is exclusively for the on-premises Exchange Servers.

About The Author

Shelly Bhardwaj linkdin

I am a Product Consultant and is associated with Stellar Data Recovery from last 8 years. I write about the latest technology tips and provide custom solutions related to Exchange Server, Office 365, ...

Google Trust
Related Posts

WHY STELLAR® IS GLOBAL LEADER

Why Choose Stellar?

  • 0M+

    Customers

  • 0+

    Years of Excellence

  • 0+

    R&D Engineers

  • 0+

    Countries

  • 0+

    PARTNERS

  • 0+

    Awards Received

BitRaser With 30 Years of Excellence
Technology You Can Trust
Data Care Experts since 1993
×