Scenario: You receive the following error when attempting to join a Mailbox server to a new DAG after removing the server from a old DAG:
Mailbox server “Servername” is a member of cluster. The server must be evicted from the cluster prior to adding it to database availability group “DAGName”
Solution:
Run Get-databaseavailabilitygroup and verify that the server is not a member of an existing DAG. If it is, run the following:
remove-databaseavailabilitygroupserver <Servername>
You may have to use the –configurationonly switch if it doesn’t remove the server properly.
If that does not work, remote into the server that is having the issue and run the following:
Remove-clusternode <servername>