There are various reasons why you would need to move emails or folders from one mailbox to another in Exchange Server. You would need to extract a particular folder or folders from an old mailbox of someone who has left the company or restructure the mailbox to another mailbox, shared folder, or public folder. To reduce the unnecessary storage space, you would need to move some specific folders as these are only important to meet the regulations or the needs of company.
Methods to Move Emails between Two Folders in a Mailbox in Exchange Server
There are two methods that you can use to copy a folder or set of folders from a mailbox to another or another resource. These are: using the Exchange Management Shell (EMS) and using Microsoft Outlook. Let’s discuss these methods in detail.
Method 1: Using the Exchange Management Shell (EMS)
You can use the PowerShell commands in the Exchange Management Shell (EMS) to export the data from a mailbox to PST and then import this PST into another mailbox. Here are the steps:
Step 1: Fulfil the Prerequisites
To perform this operation, you need to have the Mailbox Admin Role assigned to your account. This role provides the permissions to manage the mailboxes on both the source and destination, including the process to move emails and folders. To assign the roles and permissions,
- Open the Exchange Admin Center (EAC) and login with the administrative credentials.
- Click on Permissions and then click on Admin Roles.
- Click on the + button to create a new role and enter a name for the role.
- Click on the + button to add the required roles – Mailbox Import Export and Mailbox Search.
- Click the + button and add the recipients who need such permissions.
- When ready, click the Save button.
Since the operation involves exporting data, you need to create a share on the server, which allows the user doing the operation and the Exchange Server to have full access. For this,
- First, create a temporary folder. For example C:\TempExport.
- Then, right-click on the folder and click on Properties.
- Click on the Sharing tab and click on Advanced Sharing.
- Enable the Share this folder option and click on Permissions.
- Remove all the default entries and add the user and the Exchange Trusted Subsystem security group with Full Control permissions for both entries.
- Click OK. On the previous window, click OK to finalize the share.
Step 2: Export the Folder Data
Now, you can export the folders to a PST file from the source mailbox. For this, you need to use the New-MailboxExportRequest PowerShell command (see the below example).
New-MailboxExportRequest -Mailbox <SourceMailbox> -FilePath \\<Server>\<Share>\<Filename>.pst -IncludeFolders "<FolderPath>"
In the above command, the source mailbox is the mailbox from where you will be extracting the data, the file path is the full share path, and Filename is the name of PST file. To select the folders, you should have the exact name of the folder/s.
In the below example, the command will export only a folder named Important, which is a subfolder found in the Inbox folder.
New-MailboxExportRequest -Mailbox <SourceMailbox> -FilePath \\SRV01 \TempExport\Export.pst -IncludeFolders "#Inbox\Important"
To include multiple folders, you can add more folders separated by a comma (see the below example).
New-MailboxExportRequest -Mailbox <SourceMailbox> -FilePath \\SRV01 \TempExport\Export.pst -IncludeFolders "#Inbox\Important" "#Inbox\SuperImportant"
You can also move specific emails. For this, you need to first search the emails by using the Search-Mailbox command as given below.
Search-Mailbox -Identity <admin mailbox> -SearchQuery '<SearchCriteria>' -TargetMailbox <TargetMailbox> -TargetFolder <TargetFolder> -LogLevel Full
Below is an example of the command to search for emails.
Search-Mailbox -Identity administrator@mycompany.lan -SearchQuery 'Subject:"Sales"' -TargetMailbox user@mycompany.lan -TargetFolder "ExportedEmails" -LogLevel Full
After the search is completed, you need to use the New-MailboxExportRequest to export the data from the search query (see the example below).
New-MailboxExportRequest -Mailbox "Discovery Search Mailbox" -SourceRootFolder "RecoveryFolderName" -FilePath <unc path to destination>
Step 3: Monitor the Export
You need to check the status of export requests that are running to ensure the success of export. For this, you need to use the Get-MailboxExportRequest command as given below.
Get-MailboxExportRequest | Get-MailboxExportRequestStatistics
This will display the export status as Pending, Completed, or Failed.
Step 4: Import the Data into Destination Mailbox
Lastly, you can use the New-MailboxImportRequest command as given below to import the exported PST file into the destination mailbox.
New-MailboxImportRequest -Mailbox <TargetMailbox> -FilePath \\<Server>\<Share>\<Filename>.pst -TargetRootFolder "<TargetFolderPath>"
In this command, you need to specify the target mailbox, the share location of PST file, and the TargetFolderPath. In the example below, the command will import the PST file into a folder called Recovery.
New-MailboxImportRequest -Mailbox <TargetMailbox> -FilePath \\SRV01 \TempExport\Export.pst -TargetRootFolder "#Inbox\Recovery"
To import the folder into the root folder of destination mailbox, you can remove the TargetRootFolder from the command (see the below example).
New-MailboxImportRequest -Mailbox <TargetMailbox> -FilePath \\SRV01 \TempExport\Export.pst -TargetRootFolder "#Inbox\Recovery"
Method 2: Using Outlook
You can also use Outlook to move emails from one mailbox folder to another. For this, you need to have an Outlook profile set up on both the source and destination.
For moving small number of emails, you can use the drag and drop method. In this, you just need to drag the emails from one mailbox and drop them on the destination mailbox folder.
To move large folders, you can use the Import/ Export feature in Outlook. Here are the steps:
Step 1: Export the Folder Data to PST
- Open Outlook.
- Click on Open & Export and click on Import/Export.
- Click on Export to a file and click Next.
- Click on Outlook Data File (.pst) and click Next.
- Select the folder to export and click Next.
- For filtering the data, click on Filter.
- Once ready, click on Next.
- Set the location of the PST file to export. Then, click Finish.
Step 2: Import the PST File
- Click on File, click on Open & Export, and select Import/Export.
- Click on Import from another program or file and click Next.
- Click on Outlook Data File (.pst) and click Next.
- Select the PST file and click Next.
- Select the folder to import from the source file.
- Select the option to import into the current folder or the same folder in the selected mailbox profile.
- Click on Finish to start the import process.
Limitations of Above Methods
- As you have seen above, you would need to have some set of skills to export the folders or emails using the PowerShell commands. Also, there are various point of failures.
- You should also consider the fact that the databases need to be online to export the data.
- The process is lengthy and cumbersome when you need to export specific emails.
To Conclude
Above, we have explained the detailed process of moving emails or folders from one mailbox to another using PowerShell commands in Exchange Management Shell (EMS) and Outlook. However. there are some limitations of these methods. To overcome the limitations, you can use Stellar Converter for EDB. With this tool, you can open multiple Exchange Server database files from any Exchange Server version. After a quick scan, you will be shown the full structure of the database, including the mailboxes, public folders, shared mailboxes, user archives, and disabled mailboxes. You can also perform an in-line search and granularly export the mailbox items to PST or even directly to a live Exchange Server or Exchange Online. This will reduce the human error element and give you more control on the data being exported.
Was this article helpful?