-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdomain-controller.ps1
More file actions
25 lines (20 loc) · 902 Bytes
/
Copy pathdomain-controller.ps1
File metadata and controls
25 lines (20 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
param(
$domain = 'ParentDomain.local'
)
$netbiosDomain = 'parent'
$safeModeAdminstratorPassword = ConvertTo-SecureString 'This1sN0tBl@sphemyThis1sN0tM@dness!' -AsPlainText -Force
echo 'Installing the AD services and administration tools...'
Install-WindowsFeature AD-Domain-Services,RSAT-AD-AdminCenter,RSAT-ADDS-Tools
echo 'Installing the AD forest (be patient, this will take more than 30m to install)...'
Import-Module ADDSDeployment
# NB ForestMode and DomainMode are set to WinThreshold (Windows Server 2016).
# see https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/active-directory-functional-levels
Install-ADDSForest `
-InstallDns `
-ForestMode 'Win2008R2' `
-DomainMode 'Win2008R2' `
-DomainName $domain `
-DomainNetbiosName $netbiosDomain `
-SafeModeAdministratorPassword $safeModeAdminstratorPassword `
-NoRebootOnCompletion `
-Force