Pre-requirement

  1. Check and ensure the AD environment is healthy.
  • Check all DCs in this domain is working fine by running Dcdiag /v on every DC.
  • Check if AD replication works properly by running repadmin /showrepl and repadmin /replsum on every DC. 2.Back up all domain controllers if needed.

Promote Secondary Domain Controllers

  1. Install Windows, patch it to the latest patches.
  2. Run sconfig, configure the computer name, IP Address, DNS and reboot the machine.
  3. Join to the existing domain. Restart
  4. Install Domain services:
Install-WindowsFeature -Name AD-Domain-Services -IncludeManagementTools
  1. Reboot the server.
  2. Promote AD:
Install-ADDSDomainController -InstallDns -Credential (Get-Credential DOMAIN\Administrator) -DomainName contoso.com -SafeModeAdministratorPassword (ConvertTo-SecureString -AsPlainText "secret-password" -Force)

If you want to promote it using argument mode, you need to create the argument as the following:

$HashArguments = @{
    Credential = (Get-Credential "DOMAIN\Administrator")
    DomainName = "contoso.com"
    InstallDns = $true
}
Install-ADDSDomainController @HashArguments

Remove Secondary Domain Controller

To uninstall the secondary domain controller:

Uninstall-ADDSDomainController