Exchangemaster GmbH company logo

Exchangemaster GmbH - A Swiss IT Consultancy
Services
References
Partners
Contact
Getting Started
FAQs
Presentations
Articles
Community
Search
Popular
Tell-a-Friend
Follow Me

Follow exchangemaster on Twitter

Who's Online
We have 23 guests online
Syndicate
FAQ 000080 - Exporting mailboxes to .PST files in Exchange 2010 PDF Print E-mail
User Rating: / 102
PoorBest 
Written by Dejan Foro   
May 15, 2010 at 11:26 AM

This article applies to:
Exchange 2010 Rollup update 3
Outlook 2010

For mass export and import operations on mailboxes, the Export-Mailbox and Import-Mailbox PowerShell commands are used.

In Exchange 2010 these commands are hidden by default. In order to be able to use it, the user must have the Exchange "Mailbox Import Export" role assigned.

Additionally, in order for the export/import commands to be functional, Outlook 2010 64-bit client must be installed on the Exchange mailbox server where you do the export.

Currently, there is a known bug where export-mailbox and import-mailbox commands will not work on an Exchange Server that has the CAS server role installed together with the Mailbox role. If this is a case in your environment you will have to either export via Outlook or install a separate Exchange machine with only Mailbox role and Outlook 2010 64-bit in order to be able to do mass export/import.


ASSIGNING NECESSARRY ROLE AND PERMISSIONS

Members of the Microsoft Exchange Security Group "Organization Management" have the authority to assign the "Mailbox Import Export" role to other users.

To assign the "Mailbox Import Export" role to an individual user use the following syntax:
     New-ManagementRoleAssignment -Role "Mailbox Import Export" -User dejan.foro

To assign the "Mailbox Import Export"role to a Windows security group, use the following syntax.
     New-ManagementRoleAssignment -Role "Mailbox Import Export" -SecurityGroup Administrators

In addition to the "Mailbox Import Export" role, the user which will actually perform export / import must also be member of the local Administrators group on the Exchange server on which the export operation is taking place.

EXPORTING MAILBOXES TO  .PST FILES.

In order to export mailboxes to .pst
1. On an Exchange 2010 mailbox server install Outlook 2010 64-bit
2. Created the folder on your hard drive where mailboxes will be exported, for example c:\pstexport
3. Assign the role and groups membership to the person which will be doing the export
4. Export mailboxes

Here are few common export command samples:
Export a single mailbox for user dejan.foro to a directory c:\pstexport
     Export-Mailbox -Identity dejan.foro -PstFolderPath c:\pstexport

Export all mailboxes from a designated mailbox database
     Get-Mailbox -Database "mailbox database 0255331145" -ResultSize Unlimited | Export-Mailbox -PstFolderPath c:\pstexport

Export all mailboxes from a designated server
     Get-Mailbox -Server exchange02 -ResultSize Unlimited | Export-Mailbox -PstFolderPath c:\pstexport

Export all mailboxes from the entire Exchange organization (from all servers and all databases)
     Get-Mailbox -ResultSize Unlimited | Export-Mailbox -PstFolderPath c:\pstexport

Export all mailboxes for users in a specific AD Organizational Unit
     Get-Mailbox -OrganizationalUnit Marketing -ResultSize Unlimited | Export-Mailbox -PstFolderPath c:\pstexport

TROUBLESHOOTING MAILBOX EXPORT

Case 1: Export does not work when CAS role is installed together with the mailbox role.

When you try to export a mailbox to a .PST file using the Export-Mailbox PowerShell command you receive the following error:
     StatusCode : -2147221219
     StatusMessage : Error occurred in the step: Approving object. An unknown error has occurred.

Currently there is a known bug, where export-mailbox and import-mailbox commands will not work on an Exchange Server that has the CAS server role installed together with the Mailbox role.

Workaround 1
In case you have a single or smaller number of mailboxes, you can use Outlook 2010 to export user mailbox to a .PST file. In Outlook 2010 Export functionality can be found under File/Options/Advanced/Export 

Workaround 2
Install a separate Exchange machine with only Mailbox role and Outlook 2010 64-bit

CLEANING UP AFTER IMPORT OR EXPORT

After the export/import of mailbox content is completed it might be necessary to remove the permissions you have assigned.

To see who has the "Mailbox Import Export" role assigned use the following PowerShell command:
     Get-ManagementRoleAssignment -Role "Mailbox Import Export" | select Name, RoleAssigneeName | Format-Table -Auto

You will get an output similar to this:

    

Name RoleAssigneeName
----  ----------------
Mailbox Import Export-Organization Management-Delegating  Organization Management
Mailbox Import Export-Administrator  Administrator
Mailbox Import Export-Dejan Foro  Dejan Foro

The result in Name column will be used as a parameter for removal. For example to remove user Dejan Foro, following syntax would be used:
     Remove-ManagementRoleAssignment "Mailbox Import Export-Dejan Foro"

Last Updated ( May 16, 2010 at 08:15 PM )
<Previous   Next>