Windows Server 2012 and newer servers can be promoted to be a domain controller using Windows PowerShell. If you’re running your domain controllers on the Server Core variant of Windows Server, or you simply need to automate the promotion of domain controllers, PowerShell is a great way to quickly complete this task. In this guide, we’ll look at promoting an additional domain controller in to an existing domain. If you need to script the creation of a new forest or child domain, take a look at the Microsoft documentation for Install-ADDSDomainController and Install-ADDSForest.

  1. Launch an elevated Windows PowerShell prompt. On a server with the GUI installed, you can right click the PowerShell shortcut in the taskbar as shown below. On a Server Core server, type “powershell” in to the prompt.

image[2]

  1. Customize the following PowerShell script to reflect the name of the domain the server will be promoted in to as well as your Directory Services Restore Mode (DSRM) password. This script will promote a global catalog in to a domain called “cohovines.com” and install the Windows DNS Server service on the service.
$domainName = "cohovines.com"
$domainAdminCredential = Get-Credential
$dsrmPassword = (ConvertTo-SecureString -AsPlainText -Force -String "YourDSRMPassword!!")
Install-ADDSDomainController -DomainName $domainName -InstallDns -Credential $domainAdminCredential -SafeModeAdministratorPassword $dsrmPassword
  1. The server will automatically reboot once prerequisites are installed and promotion has completed.