How to Remove a DAG Member in Exchange Server 2013

When you are running an Exchange 2013 database availability group in your environment you may have a need to remove one of the servers from the DAG, for example during decommissioning of server hardware.

If you were to try and simply uninstall Exchange 2013 from the server you would encounter an error during the readiness checks.

exchange-2013-remove-dag-member-01

This computer is a member of a database availability group (DAG). It must be removed from the DAG before you can uninstall Exchange.

Following that advice if you were to try and remove the server from the DAG you may encounter this error.

exchange-2013-remove-dag-member-02

Mailbox server ‘E15MB3′ cannot be removed from the database availability group because mailbox database ‘Mailbox Database 1′ has multiple copies. Use Remove-MailboxDatabaseCopy either to remove the copy from this server or to remove the copies from other servers in the database availability group.

By now I’m sure you realise that there is a process that needs to be followed before you can uninstall Exchange 2013 from the DAG member.

  1. Removing database copies
  2. Removing the Exchange server from the DAG

Let’s take a look at those steps in more detail.

Removing Database Copies

The first part of the process is the removal of database copies. There are actually two approaches here.

  1. If you are planning to remove the server from the DAG but keep it as a standalone server hosting databases, then any copies of those databases must be removed from other DAG members first.
  2. If you are planning to completely uninstall Exchange 2013 from the server then any database copies should be removed from the server that is being uninstalled.

Technically you could use the first approach even if you plan to completely uninstall the server, but even after removing the server from the DAG you won’t be able to uninstall Exchange 2013 if it still hosts databases that contain mailboxes.

See Exchange 2013 Database Removal Error: “This mailbox database contains one or more mailboxes” for more information.

So it makes sense to use the second approach for a server that is being completely decommissioned, which is the scenario I will be using for the rest of this tutorial.

In the Exchange Admin Center navigate to Servers -> Databases and select a database that has a copy on the server you are removing from the DAG.

exchange-2013-remove-dag-member-03

If it happens to be the active database copy you would see an error and you must first switchover the database to another DAG member.

The database “Mailbox Database 3″ is currently hosted on server “E15MB3″. Use Move-ActiveMailboxDatabase to move the active copy of the database to a different server.

Click the Remove link for the database copy.

exchange-2013-remove-dag-member-04

If you have multiple database copies to remove you can use this PowerShell command to remove them all. Again, this command won’t work if the database copy is active or if it is the only copy of the database.

[PS] C:\>Get-MailboxDatabaseCopyStatus -Server E15MB3 | Remove-MailboxDatabaseCopy

Removing the Server from the Database Availability Group

After removing all database copies from the DAG member the next step is to remove it from the DAG itself.

In the Exchange Admin Center navigate to Servers -> Database Availability Groups. Select the DAG and click the Manage DAG Membership button.

exchange-2013-remove-dag-member-05

Highlight the server name and click the Remove button.

exchange-2013-remove-dag-member-06

Click Save to complete the removal process.

You can also remove the DAG member using PowerShell.

[PS] C:\>Remove-DatabaseAvailabilityGroupServer -Identity E15DAG -MailboxServer E15MB3

Removing Exchange Server 2013

Now that the Mailbox server has no databases and has been removed from the DAG, and assuming the server performs no other roles in your organization, you can uninstall Exchange 2013.

exchange-2013-remove-dag-member-07

About Paul Cunningham

Paul is a Microsoft Exchange Server MVP and publisher of Exchange Server Pro. He also holds several Microsoft certifications including for Exchange Server 2007, 2010 and 2013. Find Paul on Twitter, LinkedIn or Google+, or get in touch for consulting/support engagements.

Comments

  1. Just want to say thank you. This “How To” made me more comfortable when I decommission one of our server out of the DAG last night. We actually have Exchange 2010 but same steps. Very detailed and easy. Thanks again.

Leave a Comment

*

We are an Authorized DigiCert™ SSL Partner.