How to Recover a DAG Member Server?

Aftab Alam Aftab Alam Updated On - 24 Jan 2019

The latest versions of Exchange rely heavily on Database Availability Group (DAG)s to ensure high availability of data. They are designed to save Exchange Server and databases from any potential server failure or database corruption.

A DAG can have multiple servers as its members provided that they all have same Exchange Server versions (it means, there can never of two different versions of Exchange server in the same DAG). It can consist up to 16 Exchange Servers which further can host multiple databases. And the Database Availability Group save a server which is a member of the group from any potential catastrophe.

How to recover a DAG Server after its failure?

When an Exchange Server is a member of DAG, you can quickly recover it if it fails or gets lost. This is using the switch m:/RecoverServer which accesses the server setup in the Active Directory.

After recovering the configuration settings of the server, the switch reloads the files and services again on the server. It also applies the roles and settings which were loaded from the Server in the Active Directory.

Before starting the recovery process, let’s get some information about the Database Availability Group – what it is and how it saves the database.

To work on DAGs (to add, remove, or change settings), you must have adequate permissions. These permissions are to add, remove, and configure settings for database. Here is a table depicting permissions required for the Database Availability Group:

DAG Permissions

Features Permissions Required
Database availability group membership Organization Management

Database Availability Groups

Database availability group properties Organization Management

Database Availability Groups

Database availability groups Organization Management

Database Availability Groups

Database availability networks Organization Management

Database Availability Groups

Prerequisites of restoring a database in DAG

  • Ensure that the user account have all the permissions before starting the recovery procedure.
  • You should know the exact location of the Exchange database because the switch requires the location to recreate the files and settings. You must use the /TargetDir switch to mention the location. Even if you do not use the /TargetDir switch, the recovery operation will install the files at the default database location which is – Program Files\Microsoft\Exchange Server\V15.
  • You can manually set the saving location for the database with the help of the following steps –
  1. Start either MSC or LDP.EXE.
  2. Go to the location CN=ExServerName,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=ExOrg Name,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=DomainName,CN=Com.
  3. Go to the Exchange Server object, right-click on it, and click the Properties
  4. Search the msExchInstallPath as it stores the current Exchange database location. You can use this location while recovering the database files.

Use /m:RecoverServer switch to recover the server

Before using the RecoverServer switch you need to perform various exchange commands using Exchange Management Shell:

Step – 1: Run the command:

Get-MailboxDatabase DatabaseName | Format-List *lag*

The command will retrieve the truncation or replay log of the database copies.

Step – 2: Run the command:

Remove-MailboxDatabaseCopy DatabaseName\MailboxServerName

The command will delete any database mailbox copy which is present on the server.

Step – 3: Run the command:

Remove-DatabaseAvailabilityGroupServer -Identity DAGname -MailboxServer MailboxServerName

The command will delete the mailbox server files and settings from the respective availability group.

Step – 4: Reset the computer account in the Active Directory.

  • Follow Control Panel>>Administrative Tools>>Active Directory Users and Computers.
  • Then Click Computers.
  • After selecting the computer, right-click it and click Reset Account.

Step – 5: After resetting the computer, open the command prompt and input the command

Setup /m:RecoverServer

Step – 6: As soon as the Exchange Server recovery is complete, run the following command

Add-DatabaseAvailabilityGroupServer -Identity DAGname -MailboxServer MailboxServername

The command will add the Exchange server to the availability group.

Step – 7: Add the Exchange database copy to the server

Add-MailboxDatabaseCopy -Identity DatabaseName -MailboxServer MailboxServerName

After completing the process, you can start working on the Exchange Server and access the data in the database.

Conclusion

So, this was the complete process of recovering a Database Availability Group member Exchange server. It is quite simple and direct method of recovering the server. The method may not work well for severely affected data. So, there is no surety of recovery of data. To get an assurance, you should use Kernel for Exchange Server Recovery tool. It reads the Exchange database file directly and brings both corrupt and deleted data back. You also do not need to remember the location of the database as the software searches EDB files from any drive or folder.