[Today's post comes to us courtesy of Wayne McIntyre]
As many are already aware, exmerge is no longer supported in Exchange 2007, this has been replaced with the Power Shell cmdlets import-mailbox and export-mailbox introduced in Exchange 2007 SP1 that now handle this functionality.
This post was adapted for SBS from an Exchange team blog post by Ricardo Rosales Guerrero with permission, original Exchange team post can be found here: http://msexchangeteam.com/archive/2007/04/13/437745.aspx .
Important: If you use PSTs to migrate mailboxes from one Exchange server to another instead of using the move-mailbox procedure, you will need to read the following blogpost to correct a certain issue with replying to old email: http://blogs.technet.com/b/sbs/archive/2009/05/21/cannot-reply-to-old-emails-or-modify-old-cale...
In order to export or import mailboxes to PST files the following requirements must be met:
To grant the user running the task full mailbox access to all mailboxes the easiest way to do this is by running the below Power Shell Command:
Get-Mailbox | Add-MailboxPermission –user Username –AccessRight FullAccess –Inheritancetype all
Replace username with the Exchange Organization Admin username.
If you only wish to add permission to one specific user, simply run:
Add-MailboxPermission –Identitiy “ MailAlias” –User Username –AccessRight FullAccess –InheritanceType all
Alternatively you can also add full mailbox access through the Exchange Management Console.
The most basic cmdlet to export a mailbox to a PST file is as follows:
Export-Mailbox –Identity <mailboxUser> -PSTFolderPath <pathToSavePST>
PSTFolderPath must be a full path pointing either to a directory or to a (.pst) file. If a directory is specified a PST file named after the mailbox alias will be used as the target of the export. Note that if the PST file already exists the contents of the mailbox will be merged into it.
To export multiple mailboxes to their respective .pst files at once you can pipe in the identities of those mailboxes to the export task. Notice that when bulk exporting the PSTFolderPath parameter must forcefully point to a directory since one .pst file will be created for each mailbox.
Example:
Get-Mailbox -Database “mailbox database” | Export-Mailbox -PSTFolderPath D:\PSTs
The process for importing mailbox contents from a PST file is quite similar:
Import-Mailbox -Identity <mailboxUser> -PSTFolderPath <PSTFileLocation>
Again, PSTFolderPath must be the full path to the directory where the .pst file lives or to the (.pst) file itself. In the case where PSTFolderPath points to a directory the cmdlet will try to match the mailbox alias with the name of an existing .pst file in the specified directory and import the content of that file.
Just as with the export to PST scenario, when bulk importing mailboxes the PSTFolderPath must forcefully point to a directory and the task logic will try to match mailboxes alias with the .pst file names under that location. If no match is found for a particular mailbox, that mailbox will be skipped.
Example:
Get-Mailbox -Database “mailbox database” | Import-Mailbox -PSTFolderPath D:\PSTs
When only specific content is desired in the PST file (or back into the mailbox) a common set of filters can be used to leave out the rest of the messages. Export/Import to PST support the following filters: Locale, StartDate, EndDate, ContentKeywords, SubjectKeywords, AttachmentFileNames, AllContentKeywords, SenderKeywords, and RecipientKeywords.
Example: Import only those messages that were created between 1/1/06 and 12/1/06 and contain the word "review" in the subject and any of the words {"project","alpha"} in the body.
Import-mailbox -Identity ricardr -PSTFolderPath D:\PSTs -StartDate 1/1/06 -EndDate 12/1/06 -SubjectKeywords:'review' -ContentKeywords:'project','alpha'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.