Windows Server: Headless Domain Controller Setup: Difference between revisions

From wiki.jacobjohns.com
Added content
updated
Line 10: Line 10:
# Via CLI run the below or create a .ps1 file and execute it.
# Via CLI run the below or create a .ps1 file and execute it.
  $domain = "domain.com"
  $domain = "domain.com"
  $domainAdmin = "domain\domainAdminUser"
  $creds= Get-Credential -Username "domain\domainAdminUser"
  $sitename = "SiteName"
  $sitename = "SiteName"
  $databasepath = "E:\NTDS"
  $databasepath = "E:\NTDS"
Line 19: Line 19:
  New-Volume -DiskNumber 1 -FileSystem NTFS -FriendlyName Data -DriveLetter E  
  New-Volume -DiskNumber 1 -FileSystem NTFS -FriendlyName Data -DriveLetter E  
  Install-WindowsFeature -Name AD-Domain-Services, DNS -IncludeManagementTools -Confirm:$false
  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 (Get-Credential -Username $domainAdmin)
  Install-ADDSDomainController -CreateDnsDelegation:$false -DatabasePath $databasepath -DomainName $domain -InstallDns:$true -LogPath $logpath -NoGlobalCatalog:$false -SiteName $sitename -SysvolPath $sysvolpath -Force:$true -Credential $creds

Revision as of 22:24, 19 February 2025


  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