Mailbox Move Agent

Sharing a script that I named as Mailbox agent, it is a package of 3 scripts:




These we used during mailbox moves from old dags to newly created dags for exchange 2010.

update 1-SubmitMailBoxMoveRequests.ps1 script with OLDDAG/NewDAG name

$mbxsrvsrc = “OLDdag01”

$mbxsrvdst = “Newdag01”

Script will check the $countperday value & from each databse migrate the number of  malboxes (based on the value) to all destination databases.

Example: If DAGOLD has 4 databases & value for $countperday = 10

than 10 mailboxes from each DB will be migrated to destination databses.

if DAGNEW has 10 databases than 1 mailbox will be moved to db1, 2nd will move to db2 & soon…

Mailboxes will be equally distributed among all destination DBs. (this will be all automatic)

1-SubmitMailBoxMoveRequests.ps1  –> This will submit the requests & suspends after 95% completion

2-ResumeMailBoxMove.ps1 –> This will resume the request based on geography if required, just update the $region.

example: $region = “United Kingdom” (keep its value as * if you don’t want to use region)

3-ClearCompleteMailBoxMove.ps1 –> This will clear the completed requests.

All these scripts will send report in email, so please update the email variables inside the scripts.

$smtpserver = 

$from = 

$email1 = 

Extract the scripts from below link, hopefully these will work for you & will make mailbox moves easy.


you can also filter out the mailboxes that you want to move by updating the submit script, below is the example:

that I used to avoid migration of certain mailboxes & also just migrate the ones above 10 MB quota.

$mbx += get-mailbox -database $db -resultsize $countperday | where{(($_.MailboxMoveStatus -like “None”) -and ($_.Name -notlike “sys*”) -and ($_.ProhibitSendQuota -gt “10 MB”))}




Sukhija Vikas


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s