uninstall-adddomaincontroller -lastdomaincontrollerindomain -removeapplicationpartitions
This will still fail if you have the box ticked in AD that protects the object from deletion.
uninstall-adddomaincontroller -lastdomaincontrollerindomain -removeapplicationpartitions
This will still fail if you have the box ticked in AD that protects the object from deletion.