Wednesday, December 15, 2010

Re-balance active database copies across the DAG

Here is a handy batch file that will redistribute the active databases across the DAG:

cd C:\Program Files\Microsoft\Exchange Server\V14\Scripts
powershell -noexit -command "& ".\RedistributeActiveDatabases.ps1 -DagName DAG1 -BalanceDbsByActivationPreference -ShowFinalDatabaseDistribution -Confirm:$false" "

Copy and paste the above into notepad and save it as a batch file. Make sure you change the path for your install location as well as change the name of the DAG to match what is in your environment.