I recently encountered this error when decommissioning an Exchange 2013 Database Availability Group.
Error:
“Database availability group server EXCHANGESERVER cannot be removed from database availability group DAG since it is currently set for datacenter activation mode and it requires at least two mailbox servers.”
If we try to remove the Database Availability Group in PowerShell we get errors also.
[PS] C:\Windows\system32>Remove-DatabaseAvailabilityGroup -Identity DAG
You can use the Remove-DatabaseAvailabilityGroup cmdlet only on empty database availability groups. There are 2
servers in the group. You can use Remove-DatabaseAvailabilityGroupServer to remove the servers from the database
availability group.
+ CategoryInfo : InvalidArgument: (:) [Remove-DatabaseAvailabilityGroup], RemoveDagNeedsZeroServersExcept
ion
+ FullyQualifiedErrorId : [Server=CFEMAIL,RequestId=b8c4bfe6-52ec-4406-ace3-81621f0970b3,TimeStamp=12/18/2018 5:11
:05 PM] [FailureCategory=Cmdlet-RemoveDagNeedsZeroServersException] 91B4AE63,Microsoft.Exchange.Management.SystemC
onfigurationTasks.RemoveDatabaseAvailabilityGroup
+ PSComputerName
The error itself makes sense given that the purpose of an Exchange DAG is high availability. Exchange is trying to prevent us from reducing or impacting that high availability.
Solution:
From an Exchange PowerShell, we run the following command with the correct name of our Database Availability Group. In this case our Database Availability Group is called DAG
Set-DatabaseAvailabilityGroup <Database Availability Group Name> -DatacenterActivationMode Off
We can now remove each of the Member servers. I recommend removing them one at a time.
Now that there are no longer any member servers in the Database Availability Group, the DAG can be removed.
We can now proceed with uninstalling Exchange from each of the Exchange servers.
Lucas Guth, PEI
Exactly our problem, and the solution works. Thanks!