In the last article In the series I’ll show you how to uninstall an Active Directory Domain Control using Unattended PowerShell script.
The article below appeared In the series:
Before you start, first join the server to the domain and Install the AD DS module.
The script below will uninstall the local Domain Controller you run the script on and will set the local admin password as well.
Uninstall-ADDSDomainController -LocalAdministratorPassword (ConvertTo-SecureString -AsPlainText "p@ssw0rd" -Force) -Confirm:$false
Once done you will be signed out of the server