Installing Active Directory Domain Services on Windows Server Core is really easy. You only need to run 8 commands and your Domain Controller is ready. These steps are:
1. Rename the server
2. Set the IP and DNS address
3. Install Active Directory Domain Services Server Role
4. Promote the server to a Domain Controller
Let’s Get Started 🙂
I assume that you already have one Windows Server Core installed. If you log in, then it automatically runs command prompt.
To get to PowerShell, then just type PowerShell.exe and you are ready to configure your Domain Controller.
I don’t like that PowerShell Console because it has a black background. If you want the right PowerShell Console, then you can run the Task Manager and execute the PowerShell Console from there and then you will get the better Console 🙂
So Step 1 is to rename the server that it has the correct name. In PowerShell you can use Rename-Computer cmdlet to change name.
After that restart the server using Restart-Computer –Force command. After the reboot you can execute $env:COMPUTERNAME to verify the server name. $env:COMPUTERNAME is a PowerShell environment variable.
If the server name is OK, then we can configure the server IP and DNS address. We can use New-NetIPAddress cmdlet to set static IP address and Set-DNSClientServerAddress cmdlet to set the DNS address. Before you start configuring network adapter you need to know network adapter interface index. To get the correct network interface index we can use Get-NetAdapter cmdlet.
In this case the network adapter interface index is 12.
Run the following command to set the IP Address
Run the following command to set the DNS Address
Next step is to install the Active Directory Domain Services server role and to install server roles and features we can use Install-WindowsFeature cmdlet.
Last step is to promote the server to a Domain Controller. To promote the server to a Domain Controller, then first we need to convert Safe Mode Administrator Password to a Secure String and for that task we can use ConvertTo-SecureString cmdlet. If we have the secure string, then we can execute the Install-ADDSForest cmdlet.
As you see, it is really easy to install Active Directory Domain Services on Windows Server Core. Domain Controller is a really good example that can run on Windows Server Core. If your Domain Controller is ready, then you can enable the remote management using Enable-PSRemoting cmdlet and then you can manage your server remotely.
Here are all the commands.
#Step 1 Rename-Computer -NewName DC01 Restart-Computer -Force #Step 2 New-NetIPAddress –InterfaceIndex 12 –IPAddress 192.168.2.2 -PrefixLength 24 Set-DNSClientServerAddress –InterfaceIndex 12 -ServerAddresses 192.168.2.2 #Step 3 Install-WindowsFeature -Name AD-Domain-Services #Step 4 $Password = ConvertTo-SecureString -AsPlainText -String !1Qwertyuiopüõ -Force Install-ADDSForest -DomainName Corp.ViaMonstra.com -SafeModeAdministratorPassword $Password ` -DomainNetbiosName ViaMonstra -DomainMode Win2012R2 -ForestMode Win2012R2 -DatabasePath "%SYSTEMROOT%\NTDS" ` -LogPath "%SYSTEMROOT%\NTDS" -SysvolPath "%SYSTEMROOT%\SYSVOL" -NoRebootOnCompletion -InstallDns -Force #Step 5 Restart-Computer -Force