Guide

Join a server to the domain

A server joins the domain so it can be managed with Group Policy and signed in to with domain accounts. The join needs working DNS, an account allowed to add computers, and a move to the right OU afterwards.

10 minutes, plus a restartOn the server, then on a domain controller
What improves

The server can be managed by Group Policy and signed in to with domain accounts.

Why it matters

A server outside the domain needs its own accounts and settings, and gets none of your policies.

How you do it

Point DNS at the domain controllers, join, restart, then move the server to its OU.

Name the server and point it at the domain controllers

Set the name first. Renaming after the join is possible but untidy. DNS must point at the domain controllers, or the server cannot find the domain.

New server
Set-DnsClientServerAddress -InterfaceAlias 'Mgmt' -ServerAddresses 10.0.20.10, 10.0.20.11
Rename-Computer -NewName 'CON-HV-01' -Force
Restart-Computer -Force

Change Mgmt to the name of the server's network card. Get-NetAdapter lists them.

Check it can reach the domain

CON-HV-01
(Test-NetConnection 10.0.20.10 -Port 389 -WarningAction SilentlyContinue).TcpTestSucceeded
Resolve-DnsName ad.contoso.com

The first line should say True and the second should list your domain controllers. If either fails, fix that before you try to join.

Join

CON-HV-01
Add-Computer -DomainName 'ad.contoso.com' -Credential (Get-Credential) -Restart

Enter a domain account that is allowed to join computers, such as CONTOSO\Administrator. The server restarts as a domain member.

Accounts in Protected Users may not work here

An admin account in the Protected Users group can only sign in with Kerberos. A server that is not yet in the domain may not be able to use Kerberos for the join. If the join is refused with a sign-in error, use an admin account that is not in Protected Users.

Move it to the right OU

New computers land in the default Computers container, where your Group Policy does not reach. Move the server to the OU for its kind.

CON-DC-01
$pc = Get-ADComputer CON-HV-01
"Now in: $($pc.DistinguishedName)"
Move-ADObject -Identity $pc.DistinguishedName -TargetPath 'OU=CON-Servers,OU=Contoso School,DC=ad,DC=contoso,DC=com'

Check it

CON-DC-01
Get-ADComputer CON-HV-01 -Properties OperatingSystem | Format-List Name, OperatingSystem, DistinguishedName
Resolve-DnsName CON-HV-01.ad.contoso.com -Type A

The server should be listed in its OU, and its name should resolve to its management address. Run gpupdate /force on the server so it picks up the policies for its new OU.

Problems and fixes

"The specified domain either does not exist or could not be contacted"

DNS is wrong. The server must use the domain controllers for DNS, not the firewall or a public resolver.

"Your computer could not be joined to the domain. You have exceeded the maximum number of computer accounts"

The account is not allowed to add computers. This is by design if you followed Stop users joining computers to the domain. Use an admin account.

The test in step 2 fails straight after you set an address

Windows takes a few seconds to start using a new address. Restart the server and test again.

Done when

Check

The server is in its OU, its name resolves, and you can sign in to it with a domain admin account.

Your progress is kept in this browser only.