Tag Archives: PST

How to Export and Import mailboxes to PST files in Exchange 2007 SP1

Export/Import to PST Requirements

In order to export or import mailboxes to PST files the following requirements must be met:

  1. Export/Import to PST must be run from a 32 bit client machine with Exchange Management Tools installed (Version Exchange 2007 SP1 or later). The 32bit requirement comes from a dependency with the Outlook client.

http://www.microsoft.com/en-us/download/confirmation.aspx?id=11876

  1. Either Outlook 2003 or Outlook 2007 must be installed on the client machine.
  2. The user running the task must be an Exchange Organization Admin or an Exchange Server Admin on the server where the mailbox to export/import lives.

Exporting mailboxes to PST files

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.

After the cmdlet finishes execution, the .pst file will be ready in the specified location.

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 ‘exchange_server_name\MDB’ | Export-Mailbox -PSTFolderPath D:\PSTs

Filtering content in Export/Import to PST

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’

Issues:

When you run the command you get an error:

Error occurred in the step: Moving messages.

Failed to copy messages to the destination

mailbox store with error:

MAPI or an unspecified service provider.

ID no: 00000000-0000-00000000

It is probably because you don’t have permission to the mailboxes (it happens even if you are an administrator).

To solve this you need to get access permissions:

  1. Right click the Exchange Management Shell, and select Run as Administrator (this is a handy trick).
  2. Type the command “Get-Mailbox | Add-MailboxPermission -accessrights fullaccess -user Administrator” – if prompted, apply to ALL objects.
  3. Run the export or import.
  4. Type the command “Get-Mailbox | Remove-MailboxPermission -accessrights fullaccess -user Administrator” – Select “NO” when prompted about the Administrator mailbox! You can select “YES” for all other mailboxes, or apply to all if you want.

Sources:

http://blogs.technet.com/b/exchange/archive/2007/04/13/3401913.aspx

http://www.interworks.com/blogs/bfair/2009/08/19/empty-all-exchange-2007-mailboxes