PowerShell scripts can be run at various stages of the migration if required.
Scripts are usually run at the beginning of a migration to Exchange 2010/Office 365 to determine if users exist in the system being migrated to and to create them if required. Settings for PowerShell scripts can be found in ‘Destination Platform Migration Settings->Office 365/Exchange 2007/2010′:
Scripts are run at various points in a migration:
- PowerShell Init Script – a script run once at the start of a migration. This is usually used to set up the PowerShell and environment. The default script sets up a session with Microsoft Office 365. If you are migrating to Exchange 2010 on-premise, the script needs to be changed. If you are running CloudMigrator on the same machine as an Exchange installation then the init script can be omitted
- PowerShell Before Script – a script run for every user at the start of a user migration. This script is normally used to check if a user account exists in the destination system and to create it if not. The default script is for Office 365 and if you are migrating to Exchange 2010 on-premise, the script needs to be changed.
- PowerShell After Script – a script run for every user at the end of a user migration. There is no default setting for this script.
- PowerShell Finalize Script – a script once when the migration for all users is complete. There is no default setting for this script.
PowerShell Scripting for Specific Platforms
Depending on the version of Exchange you are migrating to, the default scripts may need to be changed. See the following articles for example scripts:
Use of Replacement Variables in PowerShell Scripts
It is possible to make use of PowerShell replacement variables to enhance the scripting capabilities of CloudMigrator.