Kernel Data Recovery Blog

How to use the Set-MailboxExportRequest Cmdlet?

Read time 4 minutes

Summary: The failure of an export request to recover EDB file data arises from the use of the PowerShell Set-MailboxExportRequest cmdlet. To apply this command, a few changes must be implemented. In the section below, we will discuss the use of the Set-MailboxExportRequest command and the must-know information about it. However, we would advise you to choose a simple method of direct export without interruptions using advanced Kernel for Exchange Server software.

Exchange databases are prone to corruption, which can put your crucial business data at risk. To protect the data, export it to PST or other destinations if necessary. Many factors generate the need to export data, such as backups, project collaboration, etc. Using Exchange PowerShell New-MailboxExportRequest Cmdlet is the standard method for creating an export request for exporting single/multiple files to PST. However, there are instances where these requests fall short and fail inconsiderably.

Then, you can utilize the Set-MailboxExportRequest cmdlet, which helps to change the request after creation and restore it from the failed request. It is used when your export process is stranded in between and causing constant failures. This command only works for requests generated from Exchange Admin Center (EAC) and Exchange Management Shell (PowerShell). This article explains the use of the “Set-Mailbox Export Request” cmdlet in Exchange Management Shell.

Understanding export request creation using New-Mailbox Export Request

Many Exchange users are aware of the “New-Mailbox Export Request” cmdlet to export Exchange mailboxes as PST files. This cmdlet basically exports EDB files from primary & archived mailboxes to save in PST file format. Exchange administrators must have assigned the Mailbox Import Export Role to carry out this export operation in the Exchange Management Shell.

The basic command for the Exchange mailbox export is:

New-MailboxExportRequest -Mailbox “mailbox name” -FilePath \\SERVER01\PSTFileShare\A_Recovered.pst

The command needs information like a mailbox name and a network shared folder path for the PST file.

These export requests do not always become a success but sometimes remain incomplete or get failed. The chances of the export failure are there with factors like incorrect or nil assignment of the export permissions, over-sized messages, bad items limit, corrupt Exchange database, etc.

For such incomplete or failed export requests, we have the “Set-Mailbox Export Request” cmdlet, which allows users to modify the export requests are pending.

Important points about “Set-Mailbox Export Request” cmdlet

The process of changing export requests after their creation comprises several aspects showing why you need to modify or recover the mailbox using it. There are some factors that you must know before heading to apply this export request mentioned below:

How to use the Set-MailboxExportRequest cmdlet?

Initially, Exchange Server allows import/export with positive success rate if the roles & permission are assigned accordingly. Exchange administrators who would be executing the cmdlet must be assigned the Mailbox Import Export Role. For that, users must launch the Exchange Management Shell and run this command to assign the Mailbox Import Export Role to the “Administrator” mailbox.

New-ManagementRoleAssignment –Role “Mailbox Import Export” –User “Administrator”

Now that all the permissions are assigned to the Exchange user or administrator, we can move to the different uses of Set-Mailbox Export Request cmdlet.

  1. Identifying name of the batch: This parameter is used to identify the BatchName that can help in the process to change Exchange export request. The command to find the BatchName is:

    Set-MailboxExportRequest –BatchName

  2. Enabling/disabling confirmation prompt: The switch Confirm allows you to set up the confirmation prompt as show or hide. The command used is:

    Set-MailboxExportRequest -Identity “John\MailboxExport01\” -BadItemLimit 22 –Confirm:$False (this command will pause the confirmation prompt)
    To receive confirmation prompt: Set-MailboxExportRequest -Identity “John\MailboxExport01\” -BadItemLimit 22 –Confirm:$True

  3. To preview the changes: The switch WhatIf is used to know about the results of using the commands for export request.

    Set-MailboxExportRequest -Identity “John\MailboxExport01\” –Priority High –WhatIf
    You can set the priority high, low, higher etc. as per your preference.

  4. To perform export allowing data loss: The switch or parameter AcceptLargeDataLoss can be used with the Set-Mailbox Export Request cmdlet to perform the export, allowing large data loss.
    Run this command.

    Set-MailboxExportRequest -Identity “<mailbox name>\MailboxExport01\” –AcceptLargeDataLoss

  5. To prioritize mailbox export request (Low, Lower, High, Higher, Highest, Emergency): One can use the Priority switch here with the common cmdlet to run the request with the required priority sequence. Here is an example.

    Set-MailboxExportRequest -Identity “<mailbox name>\MailboxExport01\” –Priority Highest

  6. To set Bad Items limit (corrupt mailbox items): The switch is BadItemLimit, and it allows the set number of bad items or corrupted items that can be skipped while performing the request. The command for it is as under.

    Set-MailboxExportRequest -Identity “<mailbox name>\MailboxExport1\” -BadItemLimit 20

  7. To set Large Items limit: Using the switch LargeItemLimit with the “Set-Mailbox Export Request” cmdlet, you can specify the number of large items that can exported during the request. Follow this command.

    Set-MailboxExportRequest -Identity “<mailbox name>\MailboxExport01\” -LargeItemLimit 25

  8. To specify an expiry or age limit for the mailbox export request: Users can utilize the CompletedRequestAgeLimit cmdlet to set a limit of days after which the export request will get automatically removed. Execute this command for it.

    Set-MailboxExportRequest -Identity “<mailbox name>\MailboxExport01\” –CompletedRequestAgeLimit 25

Not just these switches, some other switches can also be used with the Set-MailboxExportRequest cmdlet to modify the export requests in the Exchange Management Shell. Please check the switches and their roles in this cmdlet.

SWITCH ROLE
BatchName To specify the batch name
Confirm To specify if to show or hide the confirmation prompt
DomainController To specify the domain controller to read data or write from the Active Directory
Identity To specify the identity of the export request
InternalFlags To specify optional steps in the export request
RehomeRequest To specify the requests to move to the same database from which it is exported
WhatIf To view what changes would occur after applying modifications

Exporting Exchange mailboxes using Exchange Management Shell requires technical skills to execute the complex cmdlets accurately. Apart from this, users must take care of all the required permissions to execute the commands. However, some commands are limited to on-premises Exchange only. So, to simplify the process of Exchange mailbox export, Exchange administrators can try professional tools like Kernel for Exchange Server.

Simplify Exchange mailbox export using Kernel for Exchange Server

A smart way to backup Exchange Server mailboxes to Outlook PST file without any restrictions or complications is by choosing the professional Kernel for Exchange Server recovery tool. It not only helps in exporting Exchange mailboxes but also in dealing with EDB corruption and access problems in Exchange Server. The tool is a better alternative for the complex Exchange Management Shell cmdlets.

Conclusion

Exchange mailbox export is complex when performed with Exchange Management cmdlets. Any false or missed execution of Set-MailboxExportRequest Cmdlet Shell commands can show an error in the export request. The above article properly provides each Exchange PowerShell command so that you can efficiently utilize them to modify your Exchange export request. But as suggested while using the advanced software like Kernel for Exchange Server, Exchange Mailbox export is an easy affair always. By using appropriate actions, you can also resolve error of New-MailboxExportRequest access.