Exchange 2010 - Redistribute DAG's

In your Exchange 2010 environment you will need to re-balance your DAGs after you perform maintenance, if you had a failure on a server, or if your copies moved to another server.

You can manually move the databases from the Exchange Management Console but PowerShell comes to the rescue and does it for you by running one script.

Microsoft provide this script to you and it is located in the installation directory. You can find it here (if you left the default installation directory as is when you installed Exchange 2010):

  • C:\Program Files\Microsoft\Exchange Server\V14\Scripts

Take note that you can access the same script in Exchange 2013 as well. To begin, launch the Exchange Management Shell (EMS):

https://collaborationpro.com/wp-content/uploads/2017/11/EMS1.png

Next navigate to the script directory.

You can do so by typing in "cd\ and pressing enter to take you to the root of C:\ Then start typing in Program Files and press tab and it will auto complete the name. Once you have the full path press Enter so your EMS looks like the below:

https://collaborationpro.com/wp-content/uploads/2017/11/EMS2.png

The last step is to type in the command to redistribute your Exchange DAG:

  • .\RedistributeActiveDatabases.PS1 - DagName <Name of Dag> -BalanceDbsByActivationPreference -Confirm:$All

Replace <Name of Dag> with your Exchange DAG name.

Included is the -Confirm:$All switch so it saves you having to press Enter for each database that needs to be moved. In a large environment this will save you time.

The script will start. It will list the servers in the DAG and the databases and after a few seconds it will start moving them. You get a green line of code saying it was successfully moved. If you get an error then review it before trying again.