Link to home
Start Free TrialLog in
Avatar of Albert Widjaja
Albert WidjajaFlag for Australia

asked on

PowerShell script to execute mailbox migration executed by the scheduled task ?

Hi people,

Can anyone here please review my Exchange Server PowerShell below to do the mailbox migration from one Exchange Server called PROD-MBX14 into PRODMBX22-VM and then send the email out for any status complete or error ?

New-MigrationBatch –Local –Name PROD-Migration CSVData ([System.IO.File]::ReadAllBytes("C:\TEMP\Group1_Migration.csv")) –TargetDatabase SVR1-DB01, SVR1-DB02, SVR1-DB03, SVR1-DB04  -Autostart -AutoComplete
Start-MigrationBatch –Identity PROD-Migration
Complete-MigrationBatch PROD-Migration

Open in new window


In the .CSV C:\TEMP\Group1_Migration.csv, there are 688 lines of unique email address per line that is running in the old mailbox server.

What I have done manually is to select all of the mailboxes DB in the new server PRODMBX22-VM called:
PRODMBX22-VM-DB01
PRODMBX22-VM-DB02
PRODMBX22-VM-DB03
PRODMBX22-VM-DB04

But how do I do it using the script above and then executing it with the scheduled task to start the migration in the batch of 10, and then move on to the next one again?

The reason I do it 10 by 10 is that the Exchange server is running out of memory if I do it more than 10.

Thanks in advance.
SOLUTION
Avatar of Joe Klimis
Joe Klimis
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Albert Widjaja

ASKER

Thanks Joe, does the script with the command above can intelligently migrate maximum 10 at the time on the .CSV file ?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok, what about the target mailbox database ?
How can I specify more than 4 so that the mailbox is distributed automatically ?
OK, so how do I specify the email address for the migration report?
Hi , if you have specified the target Db in the CSV ,you can use an excel formula to randomize a target server.  (
This this may help )

a=As for the report when you specify  the following command at the end you can specify an email address

Complete-MigrationBatch -Identity LocalMove1 -NotificationEmails admin@contoso.com,lucio@contoso.com

Open in new window