Windows Server: Headless Domain Controller Setup: Difference between revisions
From wiki.jacobjohns.com
updated |
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" | ||
$creds= Get-Credential - | $creds= Get-Credential -UserName "domain\domainAdminUser" | ||
$sitename = "SiteName" | $sitename = "SiteName" | ||
$databasepath = "E:\NTDS" | $databasepath = "E:\NTDS" | ||
Latest revision as of 22:25, 19 February 2025

- Create the VM
- 4 CPU
- 8GB RAM
- Hard Disk 1 @ +125GB
- Hard Disk 2 @ +20GB
- Install Windows Server Core
- 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
