To schedule Mailboxes move in Exchange Server 2010 we need to do two things:
- Move request script
- Schedule the script to run using Windows task scheduler
To start, we will use this script to move the mailboxes:
add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010
Get-Content c:\scripts\users.txt |New-MoveRequest -TargetDatabase MBXNAME1 -BadItem 40
The script reads the user names from a text file stored in c:\scripts\users.txt (make sure you create the file and type the names of the users)
Don’t forget the change the name of the target DB (MBX1)
Finally save the file as .PS1
Once done we need to schedule the task:
Create a task, Make sure that PowerShell is pointing to the script file (c:\script\move.ps1)
Schedule the Task:
Configure the script to run.
To make sure the script will run OK, you should have the script file and users file in one directory.