I decided to replace one of the DCs in my test environment with a Windows 2012 Server Core machine. Server Core has really come of age in Windows 2012 â€“ its easy to configure.
Iâ€™ve covered configuring a server before but to recap:
- Rename the machine â€“ use Rename-Computer
- Set Network â€“ use Set-NetIPInterface (address) & et-DnsClientServerAddress( dns address) & Rename-netAdapter
- Join to domain â€“ use Add-Computer
To create the domain controller use the ADDSDeployment module. Youâ€™ll only find this on servers where youâ€™ve installed the AD Domain Services feature which you do like this:
Install-WindowsFeature -Name AD-Domain-Services -Confirm:$false
Import the module
Get-Command -Module ADDSDeployment
Create the Domain Controller. This is the equivalent of running DCPROMO in earlier versions. Even better you donâ€™t need the answer file. Everything is a parameter on the cmdlet.
Install-ADDSDomain Controller -DomainName “manticore.org” -InstallDns -Credential (Get-Credential manticore\richard) -ApplicationPartitionsToReplicate *
Thats it! Just wait for replication to happen.
You can also demote a domain controller
$cred = Get-Credential
Uninstall-ADDSDomainController -Credential $cred -RemoveApplicationPartitions -Confirm:$false
Restart the machine and uninstall AD & DNS
Uninstall-WindowsFeature -Name AD-Domain-Services, DNS -Confirm:$false
Restart-Computer -ComputerName dc02
Leave the domain
$cred = Get-Credential manticore\richard
Remove-Computer -UnjoinDomainCredential $cred -Workgroup Test
Trash the VM.
And best of all it works over remoting. You will need to recreate the session for restarts & changes but it is really easy.
Server Core is now a much friendlier option.