2

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

Andor
  • 152
  • 2
  • 8

2 Answers2

1

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.

downthepub
  • 117
  • 5
  • 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 03 '12 at 13:06
  • 1
    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 04 '12 at 06: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 06 '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. http://technet.microsoft.com/en-us/library/ff872148(EXCHG.141).aspx – Colyn1337 Apr 09 '14 at 14:30
1

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:

http://technet.microsoft.com/en-us/library/ff872148(EXCHG.141).aspx

Colyn1337
  • 2,397
  • 2
  • 23
  • 40