Exporting Mailbox Content
Export-Mailbox is a task developed by the migration team to allow Administrators to export content from active mailboxes to a folder inside other active mailboxes. The initial idea for this task was to be a complete replacement for ExMerge. The implementation of some of this functionality was problematic and it required more time than initially planned. In this post I will describe what we are missing, which workarounds are available, and some of our future plans.
The need for an ExMerge replacement
ExMerge is a tool created by Microsoft Support in the Exchange 5.5 timeframe, used to allow Administrators to export and import mailbox content to/from PST files. Over the years this tool became popular since, because of its flexibility, it could be used in a number of scenarios where specific tools did not exist. As a result of this popularity, the Exchange team took on development ownership of ExMerge for Exchange 2003 and released it as a tool over the web.
Even though ExMerge proved to be a helpful tool for Exchange Administrators, there were several problems that needed to be addressed in Exchange 2007:
Export-Mailbox
Export-Mailbox was built to address scenarios where mailbox content needs to be copied from one active mailbox to another without actually migrating the whole mailbox object. Source and target servers used by export-mailbox need to be part of a Single Forest or Resource Forests. That is, mailbox content can only be exported to mailboxes within the same forest.
The following versions are supported by export-mailbox:
Exchange Permission requirements:
Current functionality available for Export-Mailbox
Pre-Validation and New and Improved Logging
Export-Mailbox benefits from a pre-validation functionality similar to the one present in move-mailbox. This feature saves time by identifying most errors right away before the export begins, instead of waiting until they happen during an actual export.
Also available for Export-Mailbox is the comprehensive log feature: Event logs, a XML Report and a troubleshooting log. All logs are enabled by default and are located at <ExchangeRoot>\Logging\MigrationLogs\.
Export-mailbox available options
Features postponed
The following options were not included for Exchange 2007:
- Exporting content directly to a PST file: Part of the challenge here was to adapt our code to the Outlook PST provider, which provides the most up to date PST functionality. Currently Administrators can export content to folders inside one or more mailboxes and then manually export this content to PST files using Outlook. Also, Exchange 2007 will not actively block access from ExMerge clients supported by Exchange 2003. This is not a scenario officially tested but customers have reported that running ExMerge from an Exchange 2003 server and accessing Exchange 2007 databases indeed works. Native Exchange 2007 support for this PST is being planned to be part of Service Pack 1.
- UI interface: Since most of the common scenarios for ExMerge were related to bulk operations we have decided to focus on delivering the needed functionality first and a GUI later. There is no defined date for the creating of such interface for the export-mailbox task at this point.
Customer scenarios and examples
These are the supported customer scenarios for Export-Mailbox:
During a litigation process, Administrators may need to regularly export mailbox content from selected users. These searches will be based on criteria defined by lawyers. This content will be exported from one or more source mailboxes into a temporary mailbox that the lawyers can access. The lawyers would then process the data and send the data to opposing counsel.
When accounts are about to be removed from a server (as in college students graduating or users leaving a hosting account)administrators might want to send mailbox content to the former users that for some reason could not manually copy the email content themselves. Admin would use the Export-Mailbox option to export the data to some intermediary mailbox and then manually export data to end users via PST files.
In the course of daily operations of an IT Emergency Response organization, administrators need the ability to scan a large number of messages based on specified criteria, and perform mass deletion of any suspect email found. By using Export-Mailbox and the –DeleteContent parameter along with specific filter options, they are able to search and delete such messages.
Export-Mailbox examples:
Exporting mailbox content based on Organizational information:
Export all content from all mailboxes where user Title starts with VP to a folder called VPData in the Administrator mailbox:
Get-user | where { $_.Title -ilike "VP*" } | export-mailbox -TargetFolder "VPData" -TargetMailbox Administrator
Export all content from all mailboxes from the Accounting department to a folder called AccountingData in the Administrator mailbox:
Get-user | where { $_.Department -Eq "Accounting" } | export-mailbox -TargetFolder " AccountingData" -TargetMailbox Administrator
Using filtering when Exporting mailbox content:
Export all content from UserMailbox1's mailbox received between 02/02/05 and 02/05/05 to a folder called User1Data in the UserMailbox2's mailbox:
Export-mailbox -id UserMailbox1 –StartDate "02/02/05" –EndDate "02/05/05" -TargetFolder 'User1Data' -TargetMailbox UserMailbox2
Export all content from the Sent Items folder of UserMailbox1's mailbox to a folder called User1SentItems in the UserMailbox2's mailbox:
Export-mailbox -id UserMailbox1 -IncludeFolders "\Sent Items" -TargetFolder ' User1SentItems' -TargetMailbox UserMailbox2
Filters out content from the Deleted Items folder and only exports messages that are in Japanese to a folder called User1JapaneseItems in the UserMailbox2's mailbox:
Export-mailbox -id UserMailbox1 -ExcludeFolders "\Deleted Items" -Locale ja-jp -TargetFolder 'User1JapaneseItems' -TargetMailbox UserMailbox2
Using filtering to Export and delete mailbox content:
Export and delete all messages that contain "Confidential" in their subject from all mailboxes from the DB1 database to a folder called ConfidentialData in the Administrator mailbox:
Get-mailbox -database 'DB1' | export-mailbox –SubjectKeywords "Confidential" -TargetFolder "ConfidentialData" -TargetMailbox Administrator –DeleteContent
Export and deletes all messages that have an attachment that contains the word "movie" in its name from all mailboxes from the DB1 database to a folder called MovieAttachmentMessages in the Administrator mailbox:
Get-mailbox -database 'DB1' | export-mailbox –AttachmentFilenames "movie" -TargetFolder "MovieAttachmentData" -TargetMailbox Administrator –DeleteContent
Export and deletes all messages that contains the word "virus" in its body or in its attachment body from all mailboxes from the DB1 to a folder called VirusMessages in the Administrator mailbox:
Get-mailbox -database 'DB1' | export-mailbox -ContentKeywords "virus" -TargetFolder "VirusMessages" -TargetMailbox Administrator –DeleteContent
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.