How to install Active Directory using the dcpromo command

2 min read · Updated 11 October 2021

Did this guide help you? You can support me by subscribing to the channel, sharing it, disabling your ad blocker or making a donation. Thank you!

Hello,

Second of four articles presenting different methods for installing Active Directory:
- Installing Microsoft Active Directory via the graphical interface (server 2012, 2012r2, 2016, 2019, 2022)
- Install Microsoft Active Directory via the dcpromo  command(server 2003, 2008, 2008r2, 2012, 2012r2, 2016, 2019, 2022)
- Install Microsoft Active Directory via PowerShell (server 2012, 2012r2, 2016, 2019, 2022)
- Installing Microsoft Active Directory via PowerShell DSC (server 2016, 2019, 2022)

dcpromo is the historical command for configuring a domain controller.
It can only be used with a response file since Windows Server 2012.
The dcpromo command is available once the Active Directory Domain Services role has been installed.

dcpromo and response file

# Creating a response file named Unattend.txt in Powershell:
New-item unattend.txt -itemtype file
# Specify the following values in the file:
[DCINSTALL]
ReplicaOrNewDomain=Domain
NewDomain=Forest
NewDomainDNSName=domain.tld
DomainNetbiosName=domain
; 2 = 2003, 3 = 2008, 4 = 2008R2, 5 = Win2012, 6 = 2012R2, 7 = 2016
ForestLevel=7
DomainLevel=7
InstallDNS=Yes
ConfirmGc=Yes
CreateDNSDelegation=No
DatabasePath="C:\WindowsNTDS"
LogPath="C:\WindowsNTDS"
SYSVOLPath="C:\Windows\SYSVOL"
SafeModeAdminPassword=P@ssword
RebootOnCompletion=Yes
#Run the dcpromo command:
dcpromo /unattend:unattend.txt

Note: The password contained in the unattend.txt file is deleted once it has been used by the dcpromo command.

The Server Manager should display a warning telling you to promote the server to domain controller.
Run the wizard and close the wizard directly to stop being warned.
This problem also exists if you are doing an AD installation via MDT (Microsoft Deployment Toolkit).

Video : How to install Active Directory using the dcpromo command

Play

Related links

Follow me on

Support me

Buy Me a Coffee at ko-fi.com

New site · Reference

The Windows directory tree

Native Windows folders, files and logs: what they are for, what they contain, with commands and Microsoft sources.

Browse the tree

New site · Reference

Group Policy settings

ADMX settings for Windows 10, 11, Server and applications: registry keys, PowerShell commands and use cases.

Browse the policies