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:


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



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


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

This entry was posted in Active Directory, Active Directory Domain Services, AD Forest, DCPromo, Domain Controller, PowerShell, PowerShell 3.0, Powershell 4.0, Windows Server 2012, Windows Server 2012 R2 and tagged , , , , , , . Bookmark the permalink.

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

  1. Lemuel says:

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

  2. 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

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s