How to: move FSMO Roles, Demote and re-promote a Domain Controller with PowerShell
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkacufs3tW32upee9mxhTtsfFjyhfZEVKi3qBrTP5za49depPm8F_YcRnsrz6prJs4cXBqVMXn8u1M9zG2yD8vvaZilruWhILOA2qT2Um9O_qTlxc_WMyAUa-jM6ForWGFNoYkG1c9ow/s400/server-configuration-command-lines-on-450w-514221997.jpg)
Here are the commands you need if you want to demote and re-promote a Domain Controller with PowerShell Move FSMO Roles: Move-ADDirectoryServerOperationMasterRole -Identity nameofthedcwhereyouwanttomovetheroles -OperationMasterRole pdcemulator, ridmaster, infrastructuremaster, schemamaster, domainnamingmaster (the roles you want to move) Check if everything worked: Get-ADDomain | Select-Object InfrastructureMaster, RIDMaster, PDCEmulator Demote Demote Test Test-ADDSDomainControllerUninstallation -DemoteOperationMasterRole - LastDomainControllerInDomain -RemoveApplicationpartitions (Only needed when it is the last Domain Controller in your Environment) Start Demote Uninstall-ADDSDomainController -DemoteOperationMasterRole -RemoveApplicationPartition Promote Promote: Windows features Install-WindowsFeature -name AD-Domain-Services -IncludeManagementTools Test-Promote: Test-ADDSForestInstallation -DomainName your.dom