Windows Server Core as a domain controller
This post will describe the steps for setting up a Windows Server Core as a domain controller for an Active Directory (AD) domain. Why would you do that? Well, first and foremost, it’s very useful for a developer to have a dedicated AD Domain Controller running on Windows Server Core since it’s a much smaller and leaner operating system then the full blown Windows Server product. You’ll most likely also run your domain controller in a virtual environment such as Hyper-V or VMWare and Windows Core is much less demanding on your resources, let alone more secure since it has a much smaller attack surface area.
Steps:
Install Windows Server Core
Rename the computer
First determine the current computer name. The easiest way to do this is to type SET and copy the COMPUTERNAME
value.
1
| netdom renamecomputer <CurrentComputerName> /NewName:<YourNewName>
|
Set the IP address to a static address
1
| netsh int ip set address "Local Area Connection" static 192.168.65.210 255.255.255.0 192.168.65.2 1
|
Set the DNS Server
1
| netsh interface ipv4 add dnsserver name="Local Area Connection" address=192.168.65.2 index=1
|
Install the DNS Role
1
| start /w ocsetup DNS-Server-Core-Role
|
Create the new Domain
1
| dcpromo /unattend:c:\unattend.txt
|
Checking if Active Directory Domain Services binaries are installed… Active Directory Domain Services binaries are being installed. Please wait… And then it will continue setting up your domain and automatically reboot.
Unattend.txt sample:
1
2
3
4
5
6
7
8
9
10
| [DCINSTALL]
AutoConfigDNS=Yes
DomainNetBiosName=devdomain
NewDomainDNSName=devdomain.local
ReplicaOrNewDomain=Domain
NewDomain=Forest
ForestLevel=3
DomainLevel=3
SafeModeAdminPassword=Password1234
RebootOnSuccess=Yes
|