DAG or Database Availability Group is a collection of around 16 server mailboxes that form the base component of Exchange server. DAG hosts databases and provides an automatic database-level recovery if anything wrong goes with servers or databases. A server recovery operation can be performed in case a mailbox gets lost, crashed or otherwise fails and is not recoverable. The recovery operation will prove to be helpful in even replacing the lost mailbox. To initiate the recovery process following switch can be used- /m: RecoverServer
When the recovery process with switch /m: RecoverServer is carried out this error can occur. The reason behind this error is that the mailbox server that has crashed is still a part of DAG or in other words is still mounted on the Exchange Server. In the screenshot we can observe that the recovery process failed while diagnosing the Mailbox Role Checks. This error will ultimately lead to failure of recovery process.
In order to recover Exchange server recovery error “Exchange server is a member of a database availability group” the first thing that we need to make sure is to remove the crashed mailbox from DAG. Unless and until we dismount it from DAG, the recovery process will not work out. But one important factor that should be noted here is that if the crashed mailbox consists of any Mailbox Database copy, it cannot be removed from DAG. So the first step is to remove all the copies of the crashed server database and then afterwards remove the server mailbox from DAG.
The ConfigurationOnly switch will clean all the configurations from Active Directory.
Note: Before moving further use the /TargetDir switch to specify the location of the program files of Exchange. In case you do not use /TargetDir then the files will be installed automatically in their default location i.e. %programfiles%\Microsoft\Exchange Server\V15
The Exchange server recovery error “Exchange server is a member of a database availability group” can be easily removed by running some Exchange Management Shell commands and after it the crashed or deleted server mailbox can be added back to the DAG.