This blog post explains how to promote Windows Server 2016 to Domain controller. First, you need to check if your server is up to date. Please read this article.
Build Your Domain Controller
Let’s start by renaming your server with rename-computer cmdlet:
PS C:\Users\Administrator> $newname = “DC1” PS C:\Users\Administrator> Rename-Computer -NewName $newname -force WARNING: The changes will take effect after you restart the computer WIN-ORHN7R89G82.
Next, add the RSAT and Active Directory Tools. When it’s done, restart the server:
PS C:\Users\Administrator> $addsTools = “RSAT-AD-Tools” PS C:\Users\Administrator> Add-WindowsFeature $addsTools Success Restart Needed Exit Code Feature Result ------- -------------- --------- -------------- True No Success {Remote Server Administration Tools, Activ... PS C:\Users\Administrator> Restart-Computer
Just check the new name:
PS C:\Users\Administrator> hostname DC1
Great! Now we can install the ADDS role. Don’t forget to include the IncludeManagementTools parameter:
PS C:\Users\Administrator> Add-WindowsFeature -Name “ad-domain-services” -IncludeAllSubFeature -IncludeManagementTools Success Restart Needed Exit Code Feature Result ------- -------------- --------- -------------- True No Success {Active Directory Domain Services, Group P...
Add the DNS role:
PS C:\Users\Administrator> Add-WindowsFeature -Name “dns” -IncludeAllSubFeature -IncludeManagementTools Success Restart Needed Exit Code Feature Result ------- -------------- --------- -------------- True No Success {DNS Server, DNS Server Tools}
Everything is ok, we can deploy Active Directory:
- Set the DomainMode parameter equals to 7 (it means Windows Server 2016 level).
- Do the same thing for ForestMode parameter.
PS C:\Users\Administrator> Install-ADDSForest ` -CreateDnsDelegation:$false ` -DatabasePath "C:\Windows\NTDS" ` -DomainMode "7" ` -DomainName "get-cmd.Local" ` -DomainNetbiosName "get-cmd" ` -ForestMode "7" ` -InstallDns:$true ` -LogPath "C:\Windows\NTDS" ` -NoRebootOnCompletion:$false ` -SysvolPath "C:\Windows\SYSVOL" ` -Force:$true
Note: If you are in a production environment, I don’t recommand to deploy the NTDS Database on the same partition as Windows. Add another partition such as “D:\Windows\NTDS”.
Your server will reboot. To finish, you can check your Active Directory:
Thanks for reading! You can follow me on Twitter @PrigentNico