How To Uninstall A Domain Controller Using PowerShell

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:

Deploy Forest, Domains, And Domain Controllers Using The AD DS Deployment PowerShell Module

How To Deploy Active Directory Forest Using PowerShell

How To Deploy Active Directory Domain Controller Using PowerShell Script

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