When uninstalling an Exchange server that is part of a Database Availability Group, you perform several steps to remove the server from the DAG and maybe even delete the DAG itself.
So, after decommissioning the DAG I wanted to uninstall Exchange, but the readiness check failed with the following error message:
This computer is a member of a database availability group (DAG). It must be removed from the DAG before you can uninstall Exchange. For more information, visit: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.CannotUninstallClusterNode.aspx
Unfortunately this link has not been updates since 2015, and does not contain any useful information.
I decommissioned the DAG earlier as you can see in the following screenshot, but it still failed the readiness check:
When using the Get-DatabaseAvailabilityGroup command nothing showed up, and also when checking Active Directory with ADSI Edit (CN=Organization, CN=Administrative Groups, CN=Exchange Administrative Group (FYDIBOHF23SPDLT), CN=Database Availability Groups) nothing is shown.
The DAG is using bits of Windows failover clustering, so the culprit must be there. When executing the Get-ClusterNode and Get-Cluster commands in PowerShell, some DAG leftovers (on this particular machine) showed up:
Something must have gone wrong during decommissioning of the DAG, although no error were shown on the console.
To remove the cluster node (and thus the cluster) from this machine, execute the following command in PowerShell:
PS C:\> Remove-ClusterNode EXCH12 -Force
After this step uninstalling Exchange succeeds.