Subscribe to our Newsletter. The latest news and articles delivered to your Inbox!
Alexander Zammit has been developing server applications for over 15 years. Most of his works involve Exchange integrated applications, including a FAX server, a mail security product and anti-spam products.
Some users are discovering that the import-mailbox cmdlet has problems with importing emails from an Outlook generated PST. Today we reproduce this problem and identify some stopgap solutions.
IMPORTANT: The problem discussed in this article is now fixed in the Update Rollup 2 for Exchange Server 2007 Service Pack 1
In Replacing ExMerge by Import-Mailbox and Export-Mailbox, we saw how Exchange 2007 SP1 introduced an ExMerge replacement. This was highly awaited. The new cmdlets provided a supported alternative to ExMerge. Furthermore the new cmdlets added support for the latest PST format beating the dreaded 2GB limit.
While going through the forums (see references) I came across a problem report concerning these cmdlets. Apparently import-mailbox, when fed with an Outlook generated PST, may "succeed" without importing anything. A little trick allows us to get the cmdlet to work. However as we shall see the trick may not be viable in all cases.
The easiest way to illustrate the problem is by going through the steps I used for reproducing it.
The problem concerns PSTs generated by Outlook. Thus to begin with I created an Exchange mailbox and configured Outlook to download emails to a local PST.
A new mailbox named Mbx was created on an Exchange server. Here the Exchange version is not relevant. This is just being used to create a PST for us to test with.
On a client machine, Outlook 2003 was installed and at the profile configuration we chose "New Outlook Data File" to create the PST.
The PST file was named Mbx to match the mailbox name.
At the end, the profile was configured for emails to be downloaded to the PST.
Next we populated the PST with some items. Specifically items were created under these standard folders: Inbox, Sent Items, Drafts and Contacts. We also created and placed emails under two custom folders named ABC and XYZ. All folders containing items are highlighted in the screenshot that follows:
It is now time to run import-mailbox. Here we use a completely different Exchange 2007 mailbox server and a 32-bit Windows XP machine on which the import-mailbox cmdlet is to be run. Full details on how to setup this machine are available from, Replacing ExMerge by Import-Mailbox and Export-Mailbox.
On the target Exchange 2007 mailbox server we create a mailbox named Mbx.
We move the Mbx.pst file created earlier to the XP machine and run the import-mailbox cmdlet:
import-mailbox -identity email@example.com -PSTFolderPath e:\temp\mbx.pst
The cmdlet reports no errors, but on opening the mailbox we see that nothing was imported.
So at this stage we already reproduced one of the problems described at the forums. However this is not the end of it. A little trick is ready for the rescue.
We now run the following cmdlet
export-mailbox -identity mbx -pstfolderpath e:\temp
This will export the empty mailbox just created on Exchange 2007 to our PST. Since the mailbox is empty no new items are added however the command apparently fixes some of the issues.
We now rerun the same import command:
Magically the operation now successfully imports all items located under the standard folders (Inbox, Sent Items, Drafts and Contacts). However there is no trace of the ABC and XYZ custom folders.
So it is clear that export-mailbox did some magic to the standard folders. My guess is that since the custom folders did not exist in the exported mailbox, these were not touched by the export operation. So next we create a new mailbox and manually create the custom folders so as to replicate the structure to be imported.
We now run export-mailbox and import-mailbox in sequence. As expected everything is now imported including the custom folder items!!
An obvious question is whether ExMerge provides a viable alternative. The biggest problem in using ExMerge is the PST format. If the PST is in the Unicode format, ExMerge won't be able to process it. However if the PST were to be of the older type, then the import would work fine. All folders including the custom ones are imported without problems.
I hope this article is of assistance to those running into this problem. If you are using the old PST format, ExMerge helps you avoid the problem altogether. True ExMerge is not supported with Exchange 2007. However it does work. Check Using ExMerge with Exchange 2007 for setup details.
Otherwise the export-mailbox cmdlet gives us a simple solution for solving the problem in case of standard folders. This is not as effective in case of custom folders since we need to replicate the folder structure. Here we could focus on creating the structure of the important mailboxes ourselves and ask the "less equal" users to give us a hand with their mailbox. This is certainly far from elegant. But hey, storing emails in local PSTs is not elegant either.
Finally don't forget to drop a comment. Let me know what you think and share any other workarounds. Hopefully this article will become obsolete with the release of Exchange 2007 SP2.
TechNet Forums - Original Problem Report
Replacing ExMerge by Import-Mailbox and Export-Mailbox
Using ExMerge with Exchange 2007
Add New Comment...