Alan's sysadmin Blog

Working smarter not harder

Rebuilding an Exchange DAG

Posted by Alan McBurney on April 10, 2012


Recently I’ve been working with a customer where their DAG has been misbehaving.

The DAG was stretched between 2 AD sites. There were multiple issues with cluster resources in addition to the PAM (Primary Active Manager) not failing over properly

After looking at it for a few hours I decided that the best course of action would be to rebuild the DAG

The following are the steps required in order to remove the DAG and rebuild it

  • Remove All Database Copies from the DAG

Remove-MailboxDatabaseCopy “DBName\ServerToRemove” –Confirm:$False

  • Turn off DataCenter Activation Mode

Set-DatabaseAvailabilityGroup -Identity DAG1 -DatacenterActivationMode Off

  • Remove the MailboxServers from the DAG

Remove-MailboxDatabaseAvailabilityServer DAG1 –MailboxServer ServerToRemove

Be sure to allow time for replication to occur between executing commands

  • Recreate the DAG

New-DatabaseAvailabilityGroup -Name DAG1 –WitnessServer “WitnessServer” -WitnessDirectory D:\DAG1  -DatabaseAvailabilityGroupIpAddresses 192.168.100.100,192.168.101.100

  • Add the servers back into the DAG

Add-DatabaseAvailabilityGroupServer -Identity DAG1 –MailboxServer “SourceMBXServer”
repeat this command for all servers that you wish to add

  • Enable Database Activation Mode

Set-DatabaseAvailabilityGroup -Identity DAG1 -DatacenterActivationMode DAGOnly

  • Finally Add the mailboxdatabase copy server

Add-MailboxDatabaseCopy –Identity DBName -MailboxServer MBXServerToAdd -ActivationPreference 2

  • Finally we can test the Primary Active Manager Failover

Cluster.exe DAG1.DOMAIN.LOCAL Group “Cluster Group” /MoveTo:PassiveServerNode

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: