Script your Prepare-MoveRequest and New-MoveRequest to ease the cross forest migration process Print E-mail

Written by Praveen   
Tuesday, 05 June 2012 19:38

I have scripted the Prepare-MoveRequest and New-MoveRequest together to ease the process of cross forest mailbox migration. All you need to provide is the PrimarySMTP address of the user you wish to migrate in the input file. The script itself is self-explanatory.

 This script will only work if you have the target user as mail enabled. If you have not done, please read my previous post about preparing the target forest mail usersfor the migration.

Cross Forest Migration GAL Preparation - Exchange 2007 to 2010

 If you are ready to move, then copy the below script and save it as _PrepareAndMove.ps1

~~~~~~~~

#------------------------------------
#Script for Cross Forest Mailbox Move
#------------------------------------
Write-Host "Enter the Source Domain Migration Admin Credential"
Write-Host "Press any key when ready ..."
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
$InputFile = "C:\Migration\Input\MailEnable.csv" #User list file "MailEnable.csv" saved under the folder "C:\Migration\Input"
$SourceADServer = "dc01.ex2007forest.local" #Source Forest Domain Controller
$RemoteCredentials = Get-Credential #Enter the Source Forest Migration Crendentials

Import-Csv $InputFile |foreach{
&'c:\Program Files\Microsoft\Exchange Server\V14\Scripts\Prepare-MoveRequest.ps1' -Identity $_.PrimarySmtpAddress -RemoteForestDomainController $SourceADServer -RemoteForestCredential $RemoteCredentials -UseLocalObject
}
#------------------------------------
#Call 1 minute time wait function
#------------------------------------
#.\_Wait4OneMinute.ps1 # you will get many time wait functions, use one of them.
# time Wait function ends
#------------------------------------#Initiate MoveRequest Command Section
#------------------------------------
Import-Csv $InputFile |foreach{
New-MoveRequest -Identity $_.PrimarySmtpAddress -RemoteLegacy -RemoteGlobalCatalog $SourceADServer -RemoteCredential $RemoteCredentials -TargetDeliveryDomain email.exhchangedictionary.com
}
#End of Script

~~~~~~~

Create the input file as shown below, and save it on the path mentioned in script.

CrossForest_Move

 This should make your process easier, let me know if you face some issues.

-Praveen

AddThis Social Bookmark Button
Last Updated on Tuesday, 05 June 2012 20:27
 

Add comment


Security code
Refresh

Read In

ARCHIVES

VISITORS

mod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_counter

Online : 20
Your IP: 72.44.48.122
,

Follow Us