To test NXPowerLite for Microsoft Exchange in your live Exchange environment, you may wish to use some test email data, rather than run the application on live accounts.
One way to do this is to export existing data from your live Exchange to a .pst file which can then be re-imported to a test account that you have specifically created for testing. For example, if you have an existing account of email@example.com, you can use the export function to export emails from this account into a file called 'jsmith.pst'. The .pst file can then be imported into a new test account that you have just created e.g. firstname.lastname@example.org.
The Microsoft notes on how to export and import mail data using the Exchange Shell can be found here:
Some examples and more information can be found here (doing a web search will find more!):
The following notes explain how a basic export and import can be performed:
- Launch the Exchange Management Shell
Determine which users have Role "Mailbox Import Export" required to import and export data into mailboxes:
Get-ManagementRoleAssignment -Role "Mailbox Import Export" -GetEffectiveUsers
If the current user doesn’t have permission to import and export data, then the permission to access must be created (follow the next few steps otherwise jump to 6).
Create a role for importing and exporting if this doesn’t already exist by typing the following in the Shell:
New-RoleGroup -Name "Exchange Mailbox Import Export" -Roles "Mailbox Import Export" -DisplayName "Exchange Mailbox Import Export" -Description "This role will provide access to import and export cmdlets within entire Exchange Organisation."
- If the account you're running as is 'Administrator' then you need to assign permission to this account. In the Exchange Management Shell type the following:
New-ManagementRoleAssignment -Role "Mailbox Import Export" -User Administrator
- Restart the Exchange Management Shell.
- Perform the export: It is possible to export directly to another account but this will require having to export from live accounts numerous times which may be detrimental to performance of the live account. To export the data to a .pst file type the following command:
New-MailboxExportRequest -Mailbox some.person -FilePath \\myexchangeserver\c$\users\administrator\desktop\somePerson.pst-Mailbox specifies which mailbox to export.
-FilePath is the destination for the data.
Note that the path to the .pst file must be a UNC path and that path must be a trusted share. This command will copy the data in the mailbox for some.person to the somePerson.pst file. If there is a lot of data this could take some time.
- Perform the import: Ensure that you have created a new test mail user account (e.g. ‘email@example.com’). E.g.
New-Mailbox -UserPrincipalName firstname.lastname@example.org -Name testuser1To import type the following:
New-MailboxImportRequest -Mailbox email@example.com -FilePath \\myexchangeserver\c$\users\administrator\desktop\somePerson.pstNow all data from the .pst file should have been imported to the test account.
-Mailbox specifies into which account the data should be imported.
-FilePath specifies the mailbox data that should be imported into the specified account.
Note: After importing data, any shared items will no longer be shared.
Too much data to export/import
By using the IncludeFolders and ExcludeFolders parameters, you can specify which folders to include (for example you may only want to do the Inbox). If the Inbox is too large then you can specify to filter items out using different criteria. It would also be worth specifying -ExcludeDumpster to reduce the amount of data being copied out (see Microsoft references: Mailbox Export Reference and Mailbox Import Reference).
The export fails
Failure can often occur due to 'bad items' in the data being exported. The -BadItemLimit can be set to ignore any bad items. If the limit is set to be greater than 50 bad items then the -AcceptLargeDataLoss parameter must be used to allow greater losses than 50 items (see Microsoft reference: Mailbox Export Reference).
The import always remains queued
We have experienced an issue with Exchange 2013 where imports have remained queued for what seems an indefinite period of time. We were able to force an immediate import by restarting the Mailbox Replication Service (MRS). You may want to consider doing the same but should think about the effect this might have on other aspects of your live system.
Viewing import/export progress
Import and export requests are asynchronous and are performed by the Mailbox Replication Service (MRS). Execution may not take place immediately (may be queued). This depends on the configuration of the MRS. Each export/import action is given a default name (e.g. MailboxImport, MailboxImport1 up to MailboxImport9, similarly for export) unless the -Name parameter is used and a name is specified. There are commands that can be used to find out the status of the execution which require the action name. For example, for an import command do the following:
Get-MailboxImportRequestStatistics -Identity some.person\MailboxImport
For export the command is:
Get-MailboxExportRequestStatistics -Identity some.person\MailboxExport
To list all import requests just type;