Add a Domain to an existing ADDS Forest using Powershell

This tutorial shows you how to add a Child Domain to an existing Forest using Powershell. For this tutorial, Windows Server 2016 Standard Edition without Desktop Experience has been used. 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:

https://onkelx.nl/2017/07/28/network-and-hostname-configuration-using-powershell/

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.

Install-WindowsFeature AD-Domain-Services

In this example a child domain will be added to the forest.┬áIf the parameter ‘-DomainType’ is not specified, a child domain is created automatically. (For a new domain tree use ‘-DomainType TreeDomain’.) The name of the parent domain is lab01.local. The name of the child domain is domain01.lab01.local. DNS will be installed and DNS delegation is created so the DNS zone for domain01.lab01.local can be managed by the domain01.lab01.local domain administrators. The domain controller will be placed in the site named Site01. To add a domain to a forest, the credentials from an account that is a member of the Enterprise Admins group are required. These credentials will be asked for when the command is executed.

Example:

Install-ADDSDomain -Credential (Get-Credential LAB01\Administrator) -NewDomainName domain01 -ParentDomainName "lab01.local" -InstallDNS -CreateDNSDelegation -SiteName "Site01"

After the reboot you have a fully functional domain controller.
Because 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.

Example:

Set-DnsServerForwarder -IPAddress 8.8.8.8,8.8.4.4

You have added a domain to an existing ADDS Forest using Powershell!

If you want to install a Certificate Authority on the Domain Controller using Powershell, use this tutorial:

https://onkelx.nl/2017/07/28/install-and-configure-active-directory-certificate-authority-using-powershell/

If you want to install DHCP on the Domain Controller using Powershell, use this tutorial:

https://onkelx.nl/2017/07/28/dhcp-server-installation-and-configuration-using-powershell/

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.