Read time 4 minutes

Summary: This article highlights the importance of Database Availability Groups (DAGs) in ensuring data availability and resilience in Exchange Servers. It explains how to recover a DAG server after a failure using the “m:/RecoverServer” switch and outlines the necessary permissions. The article also provides prerequisites for restoring a database in DAG and offers a step-by-step guide for server recovery. It concludes by suggesting Kernel for Exchange Server as a more reliable data recovery tool.

The most recent iterations of Exchange place significant emphasis on the use of Database Availability Groups (DAGs) to guarantee the robust availability of data. These DAGs have been meticulously crafted to safeguard Exchange Servers and their associated databases against server failures or potential database corruption, ensuring seamless and uninterrupted data access.

A Database Availability Group (DAG) can comprise multiple servers as its members, with the prerequisite that they all share the same version of Exchange Server. This ensures that no two different Exchange Server versions coexist within the same DAG. A DAG can accommodate up to 16 Exchange Servers, each capable of hosting multiple databases. The primary purpose of a Database Availability Group is to safeguard its member servers from potential catastrophes, enhancing overall system resilience.

How to recover a DAG Server after its failure?

When an Exchange Server is part of a Database Availability Group (DAG), it offers a robust solution for swift recovery in case of failure or data loss. This is achieved through the utilization of the “m:/RecoverServer” switch, which seamlessly accesses the server configuration stored within the Active Directory.

Upon successfully retrieving the server’s configuration settings, the switch initiates a seamless process to reload both files and services onto the server. Additionally, it seamlessly incorporates the roles and settings retrieved from the server into the Active Directory, ensuring a harmonious synchronization.

Prior to commencing the recovery process, it’s essential to familiarize ourselves with the concept of the Database Availability Group (DAG) and understand its role in safeguarding the database. When working with DAGs, which entails tasks such as addition, removal, or modification of settings, it is imperative to possess the requisite permissions. These permissions encompass the ability to add, remove, and configure settings for the database. Below, you’ll find a table outlining the specific permissions necessary for managing 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

Pre-requisites 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:

  1. Run the command:
    Get-MailboxDatabase DatabaseName | Format-List *lag*

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

  2. Run the command:
    Remove-MailboxDatabaseCopy DatabaseName\MailboxServerName

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

  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.

  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.
  5. After resetting the computer, open the command prompt and input the command
    Setup /m:RecoverServer
  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.

  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.


This concludes the comprehensive process for recovering a Database Availability Group (DAG) member Exchange server. It presents a straightforward and relatively uncomplicated approach to server recovery. However, it’s important to note that this method may not be as effective for severely compromised data, and data recovery cannot be guaranteed. For a more reliable solution, consider employing Kernel for Exchange Server, an Exchange recovery tool. This robust software reads Exchange database files directly and can retrieve both corrupted and deleted data with confidence. Additionally, it eliminates the need for manual database location tracking, as it automatically searches for EDB files across various drives and folders.

Kernel for Exchange Server