Demoting the last Windows Server 2012 R2 Domain Controller with PowerShell.

As with promoting a server to domain controller, demoting the a domain controller is also a straight forward process with PowerShell. The following PowerShell cmdlets are available from the ADDSDeployment module:

Addscmdlets

Uninstall Active Directory:

The demote process got a little tricky because this was the last DC in the domain and had an Operations Master role. I used two key parameters to bypass this situation:

-DemoteOperationMasterRole []
Indicates that (forced) demotion should continue even if an operations master role is discovered on domain controller from which AD DS is
being removed.

Required? false
-ForceRemoval []
Forces the removal of a domain controller. Use this parameter to force the uninstall of AD DS if you need to remove the domain controller
and do not have connectivity to other domain controllers within the domain topology.

Required? true

Uninstall-AddsDomainController04

Uninstall-AddsDomainController05

I uninstalled the Active Directory domain services role after the demotion :

Remove-Ad-Domain-Services

After another restart, the server is clean and totally free of Active Directory.

2 responses to “Demoting the last Windows Server 2012 R2 Domain Controller with PowerShell.”

  1. Lemuel Avatar

    Thanks in support of sharing such a good idea, article is good, thats why i have read
    it fully

  2. how easy is it to get laid on tinder Avatar

    Your style is unique compared to other people
    I have read stuff from. Many thanks for posting when you’ve got the opportunity, Guess I will
    just bookmark this site.

Leave a reply to how easy is it to get laid on tinder Cancel reply

Chinny Chukwudozie, Cloud Solutions.

Passion for all things Cloud Technology.