Exchange 2010 – Import PST Into Mailbox with CAS Array
Unfortunately, using the New-MailboxImportRequest cmdlet with a CAS array doesn’t work. To workaround this we will create a Temp database, set a specific CAS server as the RpcClientAccessServer for that mailbox database, move the target mailbox to it, import the PST, and then move the mailbox back to the original database. These instructions assume you have both the Active Directory and Exchange 2010 management powershell roles/modules enabled.
When you try to use New-MailboxImportRequest with a CAS array you will receive the following error:
Couldn’t connect to target mailbox.
First we will configure the prerequisites, then we can get to work. In order for this to work, you need the PSTs on a file share, make sure you grant “Exchange Trusted Subsystem” full access to this share, otherwise you will run into errors.
Create an active directory group to grant import/export access to:
New-ADGroup -Name "ImpEx_Admins" -SamAccountName ImpExAdmins -GroupCategory Security -GroupScope Universal -DisplayName "ImpEx Admins" -Path "CN=Users,DC=Contoso,DC=Com" -Description "Members of this group are mailbox import export administrators"
Grant the created group the necessary permissions to import/export mailboxes as PSTs:
New-ManagementRoleAssignment -Name "Import Export Mailbox Admins" -SecurityGroup "ImpEx_Admins" -Role "Mailbox Import Export"
Now add yourself to that group and we can continue.
Create temporary mailbox database to move mailbox to:
New-MailboxDatabase -Name "SomeTmpDB" -EdbFilePath D:\SomePath\MailboxDatabase01.edb -LogFolderPath D:\SomePath\LogFolder
Set the RCPClientAccessServer value on the temp database to a specific CAS server:
Get-MailboxDatabase TempDB | Set-MailboxDatabase -RpcClientAccessServer cas1.domain.com
Move mailbox to MDB that has specific CAS array set as RCPClientAccessServer:
New-MoveRequest -Identity '[email protected]' -TargetDatabase SomeTmpDB
Clear the mailbox move request for the mailbox
Remove-MoveRequest -Identity '[email protected]'
Import the PST into the mailbox in a folder name “Recovery”:
New-MailboxImportRequest -Mailbox someUser -FilePath \\someserver\c$\pst\anotherUser.pst -TargetRootFolder Recovery
Remove the Mailbox Import Request
Remove-MailboxImportRequest -Identity someUser
Move the mailbox back to the original mailbox database:
New-MoveRequest -Identity '[email protected]' -TargetDatabase OriginalDB
Once the move is complete, remove the move request:
Remove-MoveRequest -Identity '[email protected]'