Change DAG database Activation Preference

The ActivationPreference decides which server will hold the active database when you automatically rebalance the databases within a DAG using the Microsoft script:

$exscripts\RedistributeActiveDatabases.ps1 -BalanceDbsByActivationPreference -confirm:$false

Changing the prefered database can only be done in PowerShell and isn’t immediately obvious…

 

Find the current Activation Preference

First of all we need to find the name and current preference of the database that we want to modify:

Get-MailboxDatabase 'exec mailboxes'|fl server, databaseCopies, activationPreference

Which gives us the results:

Server: Server-01 
DatabaseCopies: {Exec Mailboxes\Server-02, Exec Mailboxes\Server-01} 
ActivationPreference: {[Server-02, 1], [Server-01, 2]}

This tells us that the database called ‘Exec Mailboxes’ is currently active on Server-01, though it has an activationPreference of Server-02 first, and Server-01 second.  So if I was to run the rebalance script right now Exchange would attempt to move the active database to Server-02.

Change the Activation Preference

Now let’s suppose that I want to change the current activationPrference setting so that Server-01 is the preferred server.  This is the command to do it:

Set-MailboxDatabaseCopy -identity 'Exec Mailboxes\Server-01' -ActivationPreference 1

This is telling Exchange that we want to set the Activation of Exec Mailboxes on Server-01 to be a preference of 1.  Any existing preferences will be updated to accomodate this.

Confirm that the Activation Preference has been changed

Running the original command again should now return the updated preference:

Get-MailboxDatabase 'exec mailboxes'|fl server, databaseCopies, activationPreference

Which gives us the new results:

Server: Server-01 
DatabaseCopies: {Exec Mailboxes\Server-02, Exec Mailboxes\Server-01} 
ActivationPreference: {[Server-01, 1], [Server-02, 2]}

 

Posted on July 28, 2012 at 18:27 by simon · Permalink
In: Exchange 2010 · Tagged with: 

One Response

Subscribe to comments via RSS

  1. Written by Sadiq
    on 20 September 2014 at 23:19
    Reply · Permalink

    Perfect!!! thanks very much for taking thr time to share this

Subscribe to comments via RSS

Leave a Reply