Load balanced mailbox provisioning is made possible by the Mailbox Resources Management cmdlet extension agent. The Mailbox Resources Management Agent is enabled by default, and can be managed using the *-CmdletExtensionAgent cmdlets.
Load Balanced Mailbox Provisioning in Action
I wanted to see how evenly the mailboxes are distributed amongst the available databases when importing a batch of new users from a CSV file. In my lab, I have three mailbox databases; DB1, DB2 and DB3. I created a total of 20 new mailboxes from a CSV file using the following steps:First, create a password for all the accounts:
$password = ConvertTo-SecureString -AsPlainText "P@ssw0rd01" -ForceThen, create a hashtable that will be used to track the total amount of mailboxes that are created in each database. Next, import the CSV file, create the mailboxes, and increment the database count where the mailbox is created:
$db = @{} Import-Csv C:\mailboxes.csv | %{ New-Mailbox -Name $_.name -Alias $_.alias -Password $password -UserPrincipalName $_.upn | %{ $db[$_.database] = $db[$_.database] + 1 } } write $dbAfter the mailboxes are created return the hashtable with the total number of mailboxes created in each database. Here's the output from running the above code:
As you can see in the above screen shot, I provisioned 20 mailboxes that were created evenly across each database – 6 mailboxes were created in DB1, and 7 mailboxes were created in both DB2 and DB3. So, from this example we can tell that this new feature does a very good job of distributing the load when provisioning multiple mailboxes.
Excluding Databases from the Provisioning Process
You can permanently exclude databases from provisioning by setting the IsExcludedFromProvisioning property value to $true on a particular database. For example, to exclude DB2, we would run the following EMS command:Set-MailboxDatabase DB2 -IsExcludedFromProvisioning:$true
If you want to temporarily exclude the database from provisioning, set the IsSuspendedFromProvisioning property value to $true, for example:
Set-MailboxDatabase DB2 -IsSuspendedFromProvisioning:$true
So, with this in mind, I suspended DB2 from provisioning and used the code from my previous example to create another 20 mailboxes from a CSV import file to see how the new mailboxes are distributed on each available database:
We can see from the output shown above that DB2 was not used, and we've got pretty even distribution of mailboxes across both available databases.
This may seem like a small improvement over Exchange 2007, but it obviously works very well and has already proven to be very useful in my mailbox provisioning scripts
References:
http://www.mikepfeiffer.net/2010/04/testing-out-load-balanced-mailbox-provisioning-in-exchange-2010/
http://www.mikepfeiffer.net/2010/02/provision-exchange-mailboxes-from-csv-using-powershell-advanced-functions/
http://www.mikepfeiffer.net/2010/06/rbac-database-scopes-in-exchange-server-2010-sp1-beta/