In this article, we will show you how to add servers to Active Directory in Windows Server 2012, 2016 or 2019. Active Directory lets us centrally manage users, servers, printers, … there is no need to discuss the advantages of centralizing everything; if we have several interconnected servers, any change is much easier with Active Directory, hereafter AD. In this article, we will explain how to add servers to AD; you can consult these other articles: how to configure AD and how to replicate AD on a secondary server. For these 3 articles, we will use servers with these IPs:
- KB-AD-01 => 172.16.0.1
- KB-AD-02 => 172.16.0.2
- KB-SRV-01 => 172.16.0.11
- KB-SRV-02 => 172.16.0.12
Prepare the network configuration
The first thing we will do is configure our server's network adapters; basically, we will configure the DNS servers to use those configured by AD internally. We will also configure DNS records to be created only with the servers' internal IPs, avoiding problems with the firewalls in the client panel. Bear in mind that the same record can be created with both the public and private IP, and when you access it through the DNS record, it may sometimes use the public IP and sometimes the private IP -depending on the firewall configuration, this may fail-.
- Public IP network adapter:
- Disable TCP/IPv6.
- Configure DNS servers 172.16.0.1 and 172.16.0.2.
- Opciones avanzadas > DNS, disable the option to create a DNS record.
- Opciones avanzadas > WINS, disable NetBIOS over TCP/IP.
- Private network adapter:
- Disable TCP/IPv6.
- Set the IP to 172.16.0.11 -KB-SRV-01- or 172.16.0.12 -KB-SRV-02- and the subnet mask to 255.255.255.0.
- Configure DNS servers 172.16.0.1 and 172.16.0.2.
Here are some screenshots of the entire process:
Add a server to Active Directory using the graphical interface
We will open Administrador del servidor and go to Servidor local, where we will click the server name or workgroup. A new window will open, and we will click Cambiar. Now we will select the option Dominio and specify the domain we want to use, kb-test in our example. When we accept the changes, a window will open in which we must enter a username and password with sufficient permissions in our AD to add servers. Once the domain is configured, a welcome window will appear and notify us that we must restart the server to use AD. Here are screenshots of the process:
Add a server to Active Directory using commands
Another way to add our server to AD is by using commands; to do this, we will run sconfig. A window with a wizard will open; we will choose option 1 Dominio o grupo de trabajo, then choose option d Unirse al (d)ominio, which will ask us for the domain we want to join and then request a username and password for a privileged user. Once we have entered these details, it will ask whether we want to change the computer name and whether we want to restart. Here are screenshots of the process: