Share via

Recover a database availability group member server in Exchange Server

If a Mailbox server that's a member of a database availability group (DAG) is lost or fails, and is unrecoverable and needs replacement, you can run a server recovery operation.

Microsoft Exchange Server Setup includes the switch /m:RecoverServer that can be used to run the server recovery operation. Running Setup with the /m:RecoverServer switch causes Setup to read the server's configuration information from Active Directory for a server with the same name as the server from which you're running Setup.

After the server's configuration information is gathered from Active Directory, the original Exchange files and services are then installed on the server, and the roles and settings that were stored in Active Directory are then applied to the server.

Looking for other management tasks related to DAGs? Check out Manage database availability groups.

What do you need to know before you begin?

  • Estimated time to complete: 30 minutes

  • You need to be assigned permissions before you can do this procedure or procedures. To see what permissions you need, see the "Mailbox database copies" entry in the High availability and site resilience permissions topic.

  • If Exchange is installed in a location other than the default location, you must use the /TargetDir Setup switch to specify the location of the Exchange program files. If you don't use the /TargetDir switch, the Exchange program files will be installed in the default location (%programfiles%\Microsoft\Exchange Server\V15).

    To determine the install location, follow these steps:

    1. Open ADSIEDIT.MSC or LDP.EXE.

    2. Navigate to the following 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. Right-click the Exchange server object, and then click Properties.

    4. Locate the msExchInstallPath attribute. This attribute stores the current installation path.

  • For information about keyboard shortcuts that may apply to the procedures in this topic, see Keyboard shortcuts in the Exchange admin center.


Having problems? Ask for help in the Exchange forums. Visit the forums at: Exchange Server, Exchange Online, or Exchange Online Protection.

Use Setup /m:RecoverServer to recover a server

  1. Retrieve any replay lag or truncation lag settings for any mailbox database copies that exist on the server being recovered by using the Get-MailboxDatabase cmdlet:

    Get-MailboxDatabase DB1 | Format-List *lag*
  2. Remove any mailbox database copies that exist on the server being recovered by using the Remove-MailboxDatabaseCopy cmdlet:

    Remove-MailboxDatabaseCopy DB1\MBX1
  3. Remove the failed server's configuration from the DAG by using the Remove-DatabaseAvailabilityGroupServer cmdlet:

    Remove-DatabaseAvailabilityGroupServer -Identity DAG1 -MailboxServer MBX1


    If the DAG member being removed is offline and can't be brought online, you must add the -ConfigurationOnly parameter to the preceding command. If you use the -ConfigurationOnly switch, you must also manually evict the node from the cluster.

  4. Reset the server's computer account in Active Directory. For detailed steps, see Reset a Computer Account.

  5. Open a Command Prompt window. Using the original Setup media, run the following command:

    Setup /m:RecoverServer
  6. When the Setup recovery process is complete, add the recovered server to the DAG by using the Add-DatabaseAvailabilityGroupServer cmdlet:

    Add-DatabaseAvailabilityGroupServer -Identity DAG1 -MailboxServer MBX1
  7. After the server has been added back to the DAG, you can reconfigure mailbox database copies by using the Add-MailboxDatabaseCopy cmdlet. If any of the database copies being added previously had replay lag or truncation lag times greater than 0, you can use the ReplayLagTime and TruncationLagTime parameters of the Add-MailboxDatabaseCopy cmdlet to reconfigure those settings:

    Add-MailboxDatabaseCopy -Identity DB1 -MailboxServer MBX1
    Add-MailboxDatabaseCopy -Identity DB2 -MailboxServer MBX1 -ReplayLagTime 3.00:00:00
    Add-MailboxDatabaseCopy -Identity DB3 -MailboxServer MBX1 -ReplayLagTime 3.00:00:00 -TruncationLagTime 3.00:00:00


You will need to reconfigure the Virtual Directories on the recovered server and re-create any customizations you might have made. You might also need to perform additional recovery steps depending on your configuration. See Deploy the ASA credential to another Exchange server running Client Access services.

You need to import the AD FS signing certificate. See Step 1: Review the certificate requirements for AD FS.

How do you know this fix worked?

To verify that you've successfully recovered the DAG member, use the following method:

  • In the Exchange Management Shell, run the following command to verify the health and status of the recovered DAG member.

    Test-ReplicationHealth <ServerName>
    Get-MailboxDatabaseCopyStatus -Server <ServerName>

    All of the replication health tests should pass successfully, and the status of databases and their content indexes should be healthy.