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

Comments

  1. Jonby says

    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.

  2. Hein Traag says

    We were almost ready with setting up our new Exchange 2013 servers when we did a fubar action and one of us decided to delete the newly created servers and start installing from scratch. We now stil see the ‘old’ new exchange 2013 servers and dag group. Next to the 2010 servers and the ‘new’ 2013 servers and dag group.

    The failed 2013 servers are not there anymore.. how do we remove them from the list in the ECP? If you have any ideas on that we would love to know about it.

    Thanks
    Hein

      • Hein says

        Thanks Paul for the answer.

        Just to make sure i understand correctly.. we install two new servers with the exact same names as the old servers. Install Exchange on them and them do a clean uninstall?

        If that is it then we should be done in no time at all.

        Thanks for the answer and thanks for a truly helpfull website.

        • Hein Traag says

          Great. Will do just that then. Thanks for the info.

          Adding this to try and recover the migration mailbox. Apparently after installing the two new servers my now ex-colleague had removed the mailbox database on server 2. Which results in not being able to migrate mailboxes using the ECP.

          Manual commandline migration does work. Any idea on how to restore a migration mailbox so we can batch migrate using ECP?

  3. Rahamathullah says

    I want to uninstall one of my DAG member server. it has mailbox/ CAS role on it. above steps should be followed for the same.

Leave a Reply

Your email address will not be published. Required fields are marked *