There are numerous reasons why users may want to export mailboxes to, or import mailboxes from, PST files. You may want to move emails from one email account to another. Or even move Outlook mailbox data from one Windows or Mac based machine to another. Whatever the case may be, Over the course of this article, you will learn how to export Exchange Server 2010 SP1 mailboxes to PST files and import PST files to Exchange Server 2010 SP1 mailboxes.
In our environment, we have Exchange Server 2010 SP 1 installed on a server running on Windows Server 2008 R2 Enterprise edition. We will use Exchange Management Shell for both the import and the export.
Providing user rights for the Mailbox Export
A simple way to grant user rights for the mailbox export to the user (in our case the Administrator) for all mailboxes is to execute the below command in the Exchange Management Shell:
New-ManagementRoleAssignment –Role "Mailbox Import Export" –User Administrator
Creating a network share for the Mailbox Export
In the next step, a shared folder needs to be created that will be used as the file path for saving the exported PST files. Create a shared folder within which the ‘Exchange Trusted Subsystem’ group has read/write permissions.
Here, we have created a shared folder in the C:\PSTs with requisite permission:
Exporting a Single Mailbox to a PST file
New-MailboxExportRequest -Mailbox <Mailbox_name> -FilePath \\Server_name\Folder\PST_Name.pst
Get-MailboxExportRequest
Exporting All Mailboxes to PSTs
foreach ($i in (Get-Mailbox)) { New-MailboxExportRequest -Mailbox $i -FilePath "\\sp13-ex10\PSTs\$($i.Alias).pst" }
Get-MailboxExportRequest | where {$_.status -eq "Completed"}
foreach ($i in (Import-Csv .\exports.csv)) { New-MailboxExportRequest -Mailbox $i.Alias -FilePath "\\sp13-ex10\PSTs\$($i.Alias).pst" }
Removing Mailbox Export Requests
Get-MailboxExportRequest | where {$_.status -eq "Completed"} | Remove-MailboxExportRequest
Importing PST Files to Mailboxes
New-MailboxImportRequest -FilePath \\Server_name\folder\PST_name.pst -Mailbox Mailbox_name
Get-MailboxImportRequest
Dir \\sp13-ex10\PSTs\*.pst | %{ New-MailboxImportRequest -Name RecoveredPST -BatchName Recovered -Mailbox $_.BaseName -FilePath $_.FullName -TargetRootFolder SubFolderInPrimary}
Removing Mailbox Import Requests
Get-MailboxImportRequest | where {$_.status -eq "Completed"} | Remove-MailboxImportRequest
Leave a Reply