DEV Community

Vitalii Shumylo
Vitalii Shumylo

Posted on Originally published at learnitlessons.com

Promoting a domain controller with PowerShell: the short version

Promoting a Windows Server to a domain controller takes two steps, and most failed promotions come from skipping the groundwork before them. The server needs its final name, a static IP address and a DNS setting that points at itself (or at the existing DC) before you start. Renaming a DC afterwards is possible, but it is a fiddly job you can avoid.

After that, install the role, run the matching Test- cmdlet, and only then run the real promotion. The test catches the usual problems (DNS, prerequisites, forest level) before anything is changed, so you do not find out halfway through a reboot.

For a brand-new forest, the first DC looks like this:

Install-WindowsFeature -Name AD-Domain-Services -IncludeManagementTools
Test-ADDSForestInstallation -DomainName 'corp.example.test' -DomainNetbiosName 'CORP' `
    -ForestMode 'Win2025' -DomainMode 'Win2025' -InstallDns
Enter fullscreen mode Exit fullscreen mode

If the test passes, swap Test-ADDSForestInstallation for Install-ADDSForest. A second DC uses Install-ADDSDomainController instead, and the full guide also covers the checks that prove both servers really are working domain controllers: dcdiag, repadmin /replsummary and a DNS fix that people often forget on the second DC.

Read the full guide, with every step and the post-reboot checks: https://learnitlessons.com/articles/promote-domain-controller-powershell/

I also keep the lab scripts for this on GitHub: https://github.com/vitalii-shumylo/it-lab-scripts

Written with AI assistance and checked by the author.

Top comments (0)