کد:
http://www.msexchange.org/articles_tutorials/exchange-server-2007/management-administration/exchange-2007-sp1-mailbox-management-part1.html
Step by step instructions on how to import and export mailbox data to and from PST files using the enhanced Import-Mailbox and Export-Mailbox cmdlets in Exchange Server 2007 Service Pack 1.

One of the big disappointments with the Exchange Server 2007 RTM version was the lack of being able to export an Exchange 2007 mailbox to a personal folder (.PST) file using the Export-Mailbox cmdlet. Although the Microsoft Exchange Server 2003 Mailbox Merge Wizard (ExMerge) tool allowed us to extract mailbox data from an Exchange 2007 mailbox to a PST file, this scenario wasn’t tested and therefore not supported by Microsoft. This meant that this approach wasn’t commonly used in the Enterprise IT organizations around the world. Since we’re getting closer and closer to the release of the Exchange 2007 SP1 RTM version, I thought now was a good time to provide you with the steps necessary in order to not only export but also import data to and from PST files using the Export-Mailbox cmdlet.

Warning:
This article is based on the Exchange 2007 SP1 beta 2 version. Please bear in mind that you should never install a beta version of an Exchange 2007 Service Pack into your production environment. Doing so is not supported by Microsoft.
Exporting Exchange Server 2007 Mailbox Data to a PST File

Prerequisites
What came as a big surprise was that you can’t just log on to an Exchange 2007 64-bit server and then export the mailbox data to a PST file using the Export-Mailbox command. Actually it’s not possible to export data to a PST file from a 64-based Exchange 2007 server; you must instead run this cmdlet on a server or client with the 32-bit version of the Exchange 2007 System Management tools installed. In addition, you must install Outlook 2003 SP2 or later. Yes I’m not kidding here, and the reason why this is so is because Exchange 2007 doesn’t contain the Outlook PST provider like previous versions of Exchange Server did.
As many of you probably are aware, Microsoft doesn’t support installing the Outlook client on Exchange 2003, 2000 or 5.5 servers since the MAPI32.dlls included with Outlook and those included with Exchange aren’t compatible. But since Exchange 2007 doesn’t ship with the Outlook client binaries, installing Outlook 2003 SP2 or later on an Exchange 2007 server is supported. For additional information see Dave Goldman’s blog post on this topic here.
If you try to run Export-Mailbox –Identity ‘alias’ –PSTFolderPath <path to where PST should be created> in the Exchange Management Shell (EMS) on a 64-bit Exchange 2007 server without the Outlook client installed, you will receive the error message shown in Figure 1 below.

Figure 1: Export-Mailbox Error
Because 32-bit based Exchange 2007 servers aren’t supported in a production environment, this means that you must install the Exchange 2007 System Management Tools on either a 32-bit XP SP2/Vista client or Windows 2003/2008 server in your AD forest. Some of you might wonder how you’re going to install a 32-bit based Exchange 2007 server in your corporate production environment, when only the 64-bit version is supported. Well, actually the 32-bit version is supported in production but, and this is important, only for management purposes such as extending the AD schema/domain and for managing user and server objects etc. This section in the Exchange 2007 documentation library talks more about using the 32-bit version of the Exchange 2007 Management Tools to administer Exchange 2007.
Okay, so this means you must prepare a client or server in your environment by first installing the Exchange 2007 System Management tools and then Outlook 2003 SP2 or later. When you have done so, you can then log on to the respective client or server and open the Exchange Management Shell and type the following command to export a mailbox to a PST file:
Export-Mailbox –Identity ‘alias’ –PSTFolderPath <path to where PST should be created such as c:\PSTs\alias.pst>
When pressing Enter, you’ll be prompted to confirm that you really want to perform this action as shown in Figure 2.

Figure 2: Confirmation message asking whether we want to export the respective mailbox to a PST file
When clicking “Y” the respective mailbox will be opened and the Export-Mailbox cmdlet will start to move the content to the specified PST file (Figure 3).

Figure 3: Exporting Mailbox Data to a PST File
Note:
Exporting data from a mailbox to a PST file doesn't delete the content in the source mailbox. If you want to delete the content, you must include the -DeleteContent or-DeleteAssociatedMessages depending on whether you want to delete all mailbox data or just associated messages.
Depending on the server as well as size and number of items in the specified mailbox, the export can take a few minutes and more. When the export is completed, you can do whatever you want to do with it. Perhaps you’re doing a cross-forest transition for a relatively small organization and don’t want to set up a trust between the AD forests. Perhaps you simply want to archive this data for later use or simply just clean out a mailbox.
Note:
The user account you’re logged on with must have permissions to access the mailbox(es) that are to be exported to PST files. Instructions on how you give permissions to a mailbox or a mailbox database can be found here.
Okay, I now know how you can export a single mailbox to a PST file, but I have to do this for several thousand users. So how do you do you export mailbox data to PST files for users in bulk? That’s a very good question, which can be done using different approaches. To export data for all mailboxes in a particular mailbox database, you would need to pipe the result of a Get-Mailbox to the Export-Mailbox cmdlet. To do so enter the following command:
Get-Mailbox –Database <name of database> | Export-Mailbox –PSTFolderPath c:\PSTs
If you’d rather export mailbox data for user mailboxes in a particular Organizational Unit (OU) in your Active Directory forest, type:
Get-Mailbox -OrganizationalUnit <name of OU> | Export-Mailbox -PSTFolderPath c:\PSTs
What Mailbox Content is exported to the PST File?

By default, the following data is exported to the PST file unless specified otherwise:

  • All Custom Folders & Subfolders
  • Inbox
  • Deleted Items
  • Drafts
  • Junk E-Mail
  • Outbox
  • Sent Items
  • Journal
  • Calendar
  • Contacts
  • Notes
  • Tasks

If you want specific folders to be exported, you can do so using the