Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am in progress to migrate (approximately) 5000 mail-objects and I need a way /script /command that will allow me to utilize the New-MoveRequest CMD-Let in combination with the possibility to dynamically assign the TargetDatabase.

Any thoughts would be great.

Cheers, Andor

share|improve this question

Automatic mailbox distribution is your friend, from Tech-net, the TargetDatabase parameter is optional, and they say The TargetDatabase parameter specifies the identity of the database that you're moving the mailbox to. If you don't specify the TargetDatabase parameter, the command uses the automatic mailbox distribution logic to determine the database to move to.

You'll need to exclude any databases you don't want as targets, and Exchange will automagically balance them for you. Stuff on Automatic mailbox distribution at Tech-net.

share|improve this answer
Thanks again for reminding me of the 'good stuff'! – Andor Oct 3 '12 at 12:29
I am still very eager to understand if there is a possibility to script this. The advantage here is that we can control the usage of DB's and so on, whereas the Automatic Mailbox Distribution is 'random' – Andor Oct 3 '12 at 13:06
I understand where you are coming from, I too prefer to control wheere mailboxes end up! To do this, prepare a CSV file listing out Identity and TargetDatabase, putting each user in the preferred mailbox database. Then the PowerShell to move mailboxes to the corresponding mailbox database would be Import-Csv C:\Script\mailboxes.csv | ForEach-Object -Process {New-MoveRequest -Identity $_.Identity -TargetDatabase $_.TargetDatabase} – downthepub Oct 4 '12 at 6:57
I feel that I am almost there, but preparing 5000+ objects is a somewhat tedious job and wonder if there is a possibility to 'automate' the final step. In other words, what if I would like the possibility to automate the -Targetdatabase from a selection of 5 databases? – Andor Oct 6 '12 at 10:50
This post is incorrect as Exchange 2010 randomly chooses a database. It does not have any logic to it that considers database load or disk space available when choosing a database. Your link is to the 2013 version, not 2010 as indicated in the OP. – Colyn1337 Apr 9 '14 at 14:30

The automatic distribution option in Exchange 2010 is performed by random selection. However, you do have some options to control which DB's are randomly selected. The following technet article will help you:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.