Importing and Exporting data from/to PST files with Exchange 2007 SP1
| 17 March 2010
A look at how Exchange 2007 SP1 allows the import and export of data from/to PST files
Brief
In this article I will investigate the new functionality provided in Exchange 2007 SP1 to allow the import and export of PST files. I will take a look at the various options of the Import-Mailbox and Export-Mailbox commands and will also lay out the permissions required to perform the import/export processes and how to set the permissions.
Introduction
Up until Exchange 2007 RTM (Release to Manufacturing) it has been possible to import and export data to/from Exchange mailboxes using a tool called Exmerge. The Exmerge tool was excellent both as a primitive backup tool and also as a simple migration tool for small sites. With Exchange 2007 this functionality was removed from the RTM code however, after a large number of requests it has been restored in SP1 although no longer using a separate application. Now there are new extensions to the existing Import and Export mailbox commands which will allow export to a PST file. It should be noted that you can import from PSTs to a mailbox stored on the RTM version of Exchange but the command must be run from a SP1 version of Exchange. You can’t import using this method to a server running Exchange 2000 or 2003. If, however, you are exporting, you can export using the export-mailbox command from an Exchange 2000 SP3, 2003 SP2 or 2007 server.
Before I move onto the steps required to prepare for the process I will take a look at the types of PST file created and the size. As you may know prior to Outlook 2003 PST files had a size limit of 2GB beyond which corruption would occur. With Outlook 2003 a new Unicode format PST was made available which allowed much larger file sizes (up to 20GB by default). For more information about the different PST file types see the KB article here:
http://support.microsoft.com/kb/830336
Preparation
Before you can perform an import or export there are a few areas which must be addresses. The first is where you will actually run the command from. For the purposes of this article I am using a Windows XP client machine with Outlook 2007 SP1. To prepare the client machine you must install the following:
· IIS Common files
· Microsoft Management Console v3 – KB907265 – http://www.microsoft.com/downloads/details.aspx?FamilyId=61FC1C66-06F2-463C-82A2-CF20902FFAE0&displaylang=en
· Windows PowerShell 1.0 – KB926139 – http://www.microsoft.com/downloads/details.aspx?FamilyId=6CCB7E0D-8F1D-4B97-A397-47BCC8BA3806&displaylang=en
· The 32-bit version of the Exchange management tools
· Microsoft Office Outlook 2007 (RTM or SP1) or Outlook 2003 Service Pack 2 (SP2)
To install the IIS Common Files go to the Add/Remove programs control panel and select Add/Remove Windows Components. Highlight Internet Information Services (IIS) and click Details. Select the checkbox next to Common Files as shown in Figure 1, and click OK. Follow the wizard to complete the process.
Figure 1 – Installing IIS Common Files
To install the Exchange management tools, run through the first stages of setup and then select to do a custom install as shown in Figure 2.
Figure 2 – Selecting Custom setup.
Next select to only install the Management Tools as shown in Figure 3.
Figure 3 – Selecting only to install the Management Tools
Having completed the installation of all the prerequisite software the final thing to configure before importing or exporting is the relevant permissions. The account that you use to perform the import or export must have the following permissions:
· Exchange Server Administrators role
· Local Administrator on the source and target servers
· Full access to the target (or source) mailbox
To grant Exchange Server Administrator permissions open the Exchange Management Console (EMC) and select the Organization Configuration object as shown in Figure 4.
Figure 4 – The Organization Configuration tab
In the right hand pane click “Add Exchange Administrator”. This will open the wizard which is shown in Figure 5.
Click “Browse” and using the usual method locate the relevant user. Next select “Exchange Server Administrator role” and then click “Add” and locate the relevant servers as shown in Figure 5. To finish click “Add” (at the bottom of the page).
Finally use Exchange Management Shell to grant the permissions on the user mailbox. For example, to grant the user “admin” access to the mailbox “tu1” you would use the command below:
Add-MailboxPermission –Identity tu1 –User admin –AccessRights FullAccess
Import and Export
So having completed the setup let’s see what can be done with the import and export mailbox commands.
The most simple steps are the basic import and export which work as follows:
Import-Mailbox –Identity tu1 –PSTFolderPath c:\tu1.pst
Export-Mailbox –Identity tu1 –PSTFolderPath c:\tu1.pst
So those are the simplest commands but the great thing about the Import and Export mailbox commands is the flexibility which they offer. For example below are a couple of more advanced uses of the import command.
Dir C:\PSTFiles | Import-Mailbox -StartDate 01/01/2006
Get-Mailbox -OrganizationalUnit TestOU | Import-Mailbox -PSTFolderPath C:\PSTFiles
The first example will list the files in the directory C:\PSTFiles and then pipe that list to the Import-Mailbox command which will import all items created after the first of January 2006 from the PST files listed into mailboxes. The key thing is to ensure that the PST files are named with the relevant mailbox alias name.
The second example will get a list of all mailbox enabled users in the OU “TestOU” and then pipe that to the Import-Mailbox command which will then again import the PSTs identified by alias into the relevant mailboxes.
Of course there are a vast amount of options for the Import-Mailbox command so for a full list see the link below:
http://technet.microsoft.com/en-us/library/bb629586.aspx
The Export-Mailbox command works in very much the same way. Below is an example:
Get-Mailbox -OrganizationalUnit TestOU | Export-Mailbox -PSTFolderPath C:\PSTFiles -RecipientKeywords "tu1@gaots.co.uk","tu2@gaots.co.uk"
This example shows the flexibility that is possible. It first gets a list of all mailbox enabled users in the “TestOU” organisational unit and then pipes the list to the Export-Mailbox command. Here all mail which was sent to tu1 or tu2 will be exported to PST files named in conjunction with the alias of each mailbox from where the data is exported.
As with the import-mailbox command there are a whole lot of other options available so for a full list see the link below:
http://technet.microsoft.com/en-us/library/aa998579.aspx
Summary
I hope this article has given you a good insight into the new functionality available in Exchange server 2007 SP1. Microsoft has clearly listened to Exchange administrators when designing this extremely flexible solution for getting data in and out of Exchange mailboxes.
Add this page to your favorite Social Bookmarking websites
