This tutorial shows you how to add a Domain Controller to an existing ADDS Domain using Powershell. For this tutorial, Windows Server 2016 Standard Edition without Desktop Experience has been used, but it can also be used for Windows Server 2019 en 2022. This edition was known as Core Edition in previous Windows Server editions.
To configure the network adapter and change the hostname using Powershell, use this tutorial:
Log in as Administrator. A Command Shell is shown. Type ‘powershell’ and hit enter.
To install the Active Directory Domain Services, use the Install-WindowsFeature cmdlet.
In this example a new Domain Controller will be added to an existing Domain. The name of the existing Domain is ‘lab01.local’ and DNS will be installed. If there is already a separate DNS server/appliance, e.g. Infoblox, the ‘InstallDns’ parameter should be set to false (-InstallDns:$false).
The domain controller will be placed in the existing site named ‘Site01’. If a sitename is not specified, the default is the site that is associated with the subnet that includes the IP address of the server. If no such site exists, the default is the site of the replication source domain controller.
After installing the domain controller, the server will automatically reboot, unless you set the ‘NoRebootOnCompletion’ parameter to false.
Install-ADDSDomainController -DomainName 'lab01.local' -InstallDns -SiteName 'Site01' -Credential (Get-Credential 'LAB01\Administrator') -SafeModeAdministratorPassword (Get-Credential 'SafeModeAdministratorPassword').Password -NoRebootOnCompletion:$false
After the reboot you have a fully functional domain controller.
If the domain controller is also a DNS server, you might want to set DNS Forwarders. Use the Set-DnsServerForwarder cmdlet to set the forwarders. For example, use the Google DNS server addresses, or any other (public) DNS server address.
Set-DnsServerForwarder -IPAddress 220.127.116.11,18.104.22.168
You have added a domain controller to an existing ADDS domain using Powershell!
If you want to install a Certificate Authority on the Domain Controller using Powershell, use this tutorial:
If you want to install DHCP on the Domain Controller using Powershell, use this tutorial: