Good script. Have to say the Powershell engine is very powerful.
Just one question. Have you tested this code in a multiple domain environment? For example, in domain A.com, I have a user called Tom. in domain son1.A.com, I have another user also called Tom. Now if you are on a Exchange server in the subdomain and try to move mailbox for the Tom of the subdomain (son1.A.com), what will happen to the code? Will it report some errors like "this operation requires a unique object but multiple ..."
There are two options to fix this:
1. change the CSV file format of the user to:
domain/OU/userID
This is actually what the EMC does to move mailbox.
2. Or change the line below to:
============================
# Pipe all users found into the move mailbox command
$operate | Get-Mailbox | Move-Mailbox -targetdatabase $dbtarget -confirm:$false
============================
By default, get-mailbox only get the local mailboxes.