Skip to content

Instantly share code, notes, and snippets.

@PixelRobots
Created April 22, 2017 14:44
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 PixelRobots/852e3675270c17d084f93074b595d59b to your computer and use it in GitHub Desktop.
Save PixelRobots/852e3675270c17d084f93074b595d59b to your computer and use it in GitHub Desktop.
# Install ADDS and all management tools
Add-WindowsFeature -Name “ad-domain-services” -IncludeAllSubFeature -IncludeManagementTools
# Add Domain Controller to existing Forest
write-Host "Add Dc to existing Forest"
$domainname = Read-Host "Enter Domain Name you want to join eg: ad.contoso.com"
$sitename = read-host "Enter name of site to join. eg: Default-First-Site"
Import-Module ADDSDeployment
Install-ADDSDomainController `
-NoGlobalCatalog:$false `
-CreateDnsDelegation:$false `
-Credential (Get-Credential) `
-CriticalReplicationOnly:$false `
-DatabasePath "C:\Windowes\NTDS" `
-DomainName:$domainname `
-InstallDns:$true `
-LogPath "C:\Windowes\NTDS Logs" `
-NoRebootOnCompletion:$false `
-SiteName:$sitename `
-SysvolPath "C:\Windowes\SYSVOL" `
-Force:$true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment