The official blog for Windows Server Essentials and Small Business Server support and product group communications.
[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-calendar-items-after-pst-mail-migration.aspx
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.
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'
Does this procedure take into account locales other than US English? Thise that use special fonts/character sets etc?
ExMerge had a limited set and I hope that whatever procedure replaces it expands those capabilities.
See http://www.petri.co.il/exmerge_and_hebrew_fonts.htm for ExMerge limitations.
Hi, Is there a 2GB size limit on the PST export like there was in exmerge?
thanks
The installation of Exchange Management Tools also requires MMC 3.0, which I couldn't install on my Windows XP Pro SP2 because I have a Swedish installation. So I guess we can add an English OS to the requirements.
There is no 2gb size limit, it uses the size limit configured for outlook, which you can configure following this kb, I think the default is 20gb
832925 How to configure the size limit for both (.pst) and (.ost) files in Outlook 2007 and in Outlook 2003
http://support.microsoft.com/default.aspx?scid=kb;EN-US;832925
So the short version is that Powershell's mailbox import/export cmdlets are missing some serious builtin functionality?
Develop a cmdlet that only runs on a 32bit OS to control servers that require 64bit? So no more running imports directly from the server?
Outlook is required to be installed? "take 2"... So no more running imports directly from the server? (assuming installing Outlook on an exchange server is still bad mojo)
And the best part is that they retired exmerge before they had full mailbox export functionality in Powershell.
Perfect.
Hi,
if you are bulk importing more than just one *.pst file for one user, how can you specify the setting "dont import duplicates"?
Thanks
[Today's post comes to us courtesy of Wayne McIntyre] There are many reasons why a company may need or