Exchange 2010 SP1 introduces a new cmdlet set to handle mailbox export requests to avoid the previous requirement to install Outlook on mailbox servers. With SP1 you can run the New-MailboxExportRequest cmdlet to create a request for the Mailbox Replication Service (MRS) running on a Client Access Server (CAS) to export data from a mailbox to a PST located in a file share that is protected from prying eyes by the Exchange Trusted Subsystem security group.
Much the same approach is taken for mailbox import requests. In this instance, you create an import request with the New-MailboxImportRequest cmdlet to instruct MRS to access data in a PST located in a file share and import the data into a target mailbox.
It seems clear that Microsoft is steadily moving toward using the MRS as the fulcrum for mailbox maintenance operations. It therefore comes as no surprise that the mechanism used for mailbox export and import requests shares some of the maintenance issues that afflict mailbox move requests, which were the first operation moved to MRS in Exchange 2010. Mailbox export and import requests accumulate and are not cleared out automatically even when they are successful. There is no aging mechanism either whereby Exchange might clean up old requests after they exceed a set limit such as 30 or 60 days. The logic might be that it is possible that you want to retain export or import requests as proof that a certain operation occurred.
The upshot is that you therefore should remove old requests periodically. This is much the same basic housekeeping that you have to perform for mailbox move requests as described in this post.
The appropriate way to do this is to run the following commands to clean up old import and export requests that have completed successfully (make sure that you are sure that you don’t want to keep any requests for whatever reason before you execute these commands).
Get-MailboxImportRequest -Status Completed | Remove-MailboxImportRequest
Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequest
Some administrators perform mailbox exports before they delete mailboxes to be sure that all of the mailbox content is accessible should the need arise. Others opt to hide the mailbox and disable the Active Directory account and are happy for the mailbox content to stay in the database for a month or so before they delete the mailbox. Whatever approach you take, you won’t be able to remove old mailbox import or export requests if you delete the Active Directory account beforehand. This is because Exchange uses some Active Directory attributes to link the mailbox to the information MRS maintains about requests so you’ll end up with a “lingering” or “orphan” export or import request if you delete the Active Directory account before you clean them up.
Microsoft acknowledges that this is a bug and code will no doubt appear in the future to manage orphan import and export requests a tad better. In the meantime, the sequence is:
- Export the mailbox and check that the export request completed successfully (use the Get-MailboxExportRequestStatistics cmdlet with the -IncludeReport parameter)
- Check that all is well with the data exported to the PST (open the PST and validate the contents)
- Remove export requests for the mailbox with the Remove-MailboxExportRequest cmdlet.
- Delete the Active Directory account and mailbox. This can be done with the Remove-Mailbox or Remove-StoreMailbox cmdlets. Remove-StoreMailbox is new for Exchange 2010 SP1 and is used to remove a mailbox from its database immediately.
MRS is certainly a central player for Exchange management going forward. For now, it works very well in most circumstances and issues like this are just minor tweaking. For more information about how to export mailbox data with Exchange 2010 SP1, see pages 758 to 760 in chapter 12 of Microsoft Exchange Server 2010 Inside Out, also available at Amazon.co.uk. The book is also available in a Kindle edition. Other e-book formats for the book are available from the O’Reilly web site. General information about how MRS processes mailbox export and import requests can be found on pages 747-758 onward.
Follow Tony @12Knocksinna