Created
May 26, 2018 13:01
-
-
Save nivleshc/eb404932de872c0bfa49c7b05ca2c3f3 to your computer and use it in GitHub Desktop.
Configure-ADForest.ps1 PowerShell script used by CloudFormation template to deploy Active Directory Domain Services
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory=$true)] | |
[string]$DomainName, | |
[Parameter(Mandatory=$true)] | |
[string]$DomainNetBiosName, | |
[Parameter(Mandatory=$true)] | |
[string]$DomainMode, | |
[Parameter(Mandatory=$true)] | |
[string]$ForestMode, | |
[Parameter(Mandatory=$true)] | |
[string]$SafeModeAdministratorPassword | |
) | |
# Create New Forest, add Domain Controller | |
Import-Module ADDSDeployment | |
#Convert the SafeModeAdministratorPassword to a secureString | |
$SecuredSafeModeAdministratorPassword = ConvertTo-SecureString -String $SafeModeAdministratorPassword -AsPlainText -Force | |
Install-ADDSForest -CreateDnsDelegation:$false ` | |
-DomainName $DomainName ` | |
-DomainNetbiosName $DomainNetbiosName ` | |
-DatabasePath "C:\Windows\NTDS" ` | |
-DomainMode $DomainMode ` | |
-ForestMode $ForestMode ` | |
-SafeModeAdministratorPassword $SecuredSafeModeAdministratorPassword ` | |
-InstallDns:$true ` | |
-LogPath "C:\Windows\NTDS" ` | |
-NoRebootOnCompletion:$false ` | |
-SysvolPath "C:\Windows\SYSVOL" ` | |
-Force:$true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment