Windows Server: Headless Domain Controller Setup

From wiki.jacobjohns.com

  1. Create the VM
    • 4 CPU
    • 8GB RAM
    • Hard Disk 1 @ +125GB
    • Hard Disk 2 @ +20GB
  2. Install Windows Server Core
  3. Via CLI run the below or create a .ps1 file and execute it.
$domain = "domain.com"
$creds= Get-Credential -UserName "domain\domainAdminUser"
$sitename = "SiteName"
$databasepath = "E:\NTDS"
$logpath = "E:\NTDS"
$sysvolpath = "E:\SYSVOL"

Initialize-Disk -Number 1
New-Volume -DiskNumber 1 -FileSystem NTFS -FriendlyName Data -DriveLetter E 
Install-WindowsFeature -Name AD-Domain-Services, DNS -IncludeManagementTools -Confirm:$false
Install-ADDSDomainController -CreateDnsDelegation:$false -DatabasePath $databasepath -DomainName $domain -InstallDns:$true -LogPath $logpath -NoGlobalCatalog:$false -SiteName $sitename -SysvolPath $sysvolpath -Force:$true -Credential $creds