In one of my older blog posts we encountered an error while trying to decommission a DAG and remove the members.
Now when trying to do a recovery installation, the error below is pretty straight forward compared to what is listed in the previous blog post but the removal process is the same.
As you can see above, it tells you the server is part of database availability group.
The command to remove this is below:
- Remove-DatabaseAvailabilityGroupServer -Identity DAGNAME -MailboxServer ServerName -ConfigurationOnly
The last part is basically evicting the node from the cluster as per the other post.
Hope it helps.