Skip to content

Instantly share code, notes, and snippets.

@ryanmaclean
Created March 26, 2021 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanmaclean/434352ae87967c0c5c46c03d4442d2bf to your computer and use it in GitHub Desktop.
Save ryanmaclean/434352ae87967c0c5c46c03d4442d2bf to your computer and use it in GitHub Desktop.
Active Directory Install Script for Server 2019
$DSRMPass = ConvertTo-SecureString -String "CHANGEME" -AsPlainText -Force
Install-WindowsFeature -Name AD-Domain-Services -IncludeManagementTools
Install-ADDSForest `
-CreateDnsDelegation:$false `
-DatabasePath "C:\Windows\NTDS" `
-DomainMode 7 `
-ForestMode 7 `
-DomainName "lab.local" `
-InstallDns:$true `
-SafeModeAdministratorPassword $DSRMPass `
-NoRebootOnCompletion:$false `
-SysvolPath "C:\Windows\SYSVOL" `
-LogPath "C:\Windows\NTDS" `
-Force:$true
Write-Verbose "Rebooting DC1 to start domain" -Verbose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment