Demote server 2012 R2 with Powershell
March 5, 2019
Steven Whiting
uninstall-adddomaincontroller -lastdomaincontrollerindomain -removeapplicationpartitions
This will still fail if you have the box ticked in AD that protects the object from deletion.