Share via


Exchange 2016 Troublshooting: Error ‘New-MailboxExportRequest is not Recognized’?

For exporting mailboxes in Exchange Server 2016, you need to use either the Exchange Admin Center (EAC) or the Exchange Management Shell (EMS). To export only one mailbox, you can use the portal. However, if you need to export several mailboxes with some parameters, you need to script the job in PowerShell.

You need to use the New-MailboxExportRequest command (as given below) to export a mailbox to PST.

New-MailboxExportRequest -mailbox user1 -filepath "\Server\PST_Export\UserExport1.pst"

This command will work and successfully export the mailbox to PST.

However, sometimes, you encounter an error (see below) stating that the command used is not recognized.

The term 'New-MailboxExportRequest' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

At line:1 char:25

  • New-MailboxExportRequest <<<<  -Mailbox username -FilePath C:\Export\User1.pst
  • CategoryInfo : ObjectNotFound: (New-MailboxExportRequest:String) [], CommandNotFoundException
  • FullyQualifiedErrorId : CommandNotFoundException

The message is a bit misleading because the command is correct. It says that it was mistyped and it does not exist. The command must exist in the Exchange environment as it is a part of the commands in the system.

How to Fix the ‘New-MailboxExportRequest is not Recognized’ Error?

The first thing to do is check that you are running the New-MailboxExportRequest from a PowerShell window and not the Exchange Management Shell (EMS). Make sure that the window’s top bar is showing that the Management Shell is running. PowerShell alone doesn’t know the command and the Exchange Modules must be loaded in order to run this and other commands of Exchange Server.

The next thing to do is check that the user you are using to export the mailbox has the necessary permissions to export the data. Although you might be running the command as the domain administrator, it does not mean that you can export the data. To set the right permissions, open the Exchange Admin Center (EAC), click on Permissions, and then click on Admin Roles.

Click the + button and add the new role called Export, add the role of Import/Export, and add the user or users who will need to export mailboxes from the Exchange Server.

To assign permissions by using the Exchange Management Shell (EMS), run the below commands.

New-ManagementRoleAssignment –Role "Mailbox Import Export" –User "<Username>"

New-ManagementRoleAssignment -Role "Mailbox Import Export" -SecurityGroup "Organization Management" -Name "Import Export"

Next, you need to check that the UNC path, you are exporting to, has the right permissions. You should have the Exchange Trusted Subsystem, with full permissions on the share and the underlying folders of the path.

To check this, follow these steps:

  • Open the folder that you’ve shared, right-click on the folder and click on Properties.
  • Click on the Sharing and Advanced Sharing.
  • Click on Permissions and make sure that the Exchange Trusted Subsystem is there and has full rights.

If it is not added, you must add this group so that Exchange Server has the right permissions to write in the specified folder.

With all these checks done, you should be able to use the New-MailboxExportRequest to export a mailbox to PST.

If nothing works, it is suggested to check if there are any underlying issues or the server might need some critical updates to fix any issues that are causing the error.

An Alternative Solution

Alternatively, if the mailboxes are not large, you can use Outlook or the Exchange Admin Center to export the mailboxes.