Update windows-ad/populate_ad/install.ps1
This commit is contained in:
parent
e59e89705e
commit
506e1cbd40
|
@ -8,26 +8,20 @@ Install-WindowsFeature -Name AD-Domain-Services -IncludeManagementTools
|
||||||
Import-Module ADDSDeployment
|
Import-Module ADDSDeployment
|
||||||
|
|
||||||
# Configure new domain
|
# Configure new domain
|
||||||
$DomainName = "${domain_name}"
|
|
||||||
$DomainNetBiosName = "${domain_netbios_name}"
|
|
||||||
$SafeModePassword = ConvertTo-SecureString -AsPlainText "${safe_mode_password}" -Force
|
|
||||||
$DomainAdminPassword = ConvertTo-SecureString -AsPlainText "${domain_admin_password}" -Force
|
|
||||||
|
|
||||||
# https://learn.microsoft.com/en-us/powershell/module/addsdeployment/install-addsforest?view=windowsserver2022-ps
|
# https://learn.microsoft.com/en-us/powershell/module/addsdeployment/install-addsforest?view=windowsserver2022-ps
|
||||||
$HashArguments = @{
|
$HashArguments = @{
|
||||||
# DatabasePath = "d:\NTDS"
|
# DatabasePath = "d:\NTDS"
|
||||||
# LogPath = "e:\Logs"
|
# LogPath = "e:\Logs"
|
||||||
# SysvolPath = "d:\SYSVOL"
|
# SysvolPath = "d:\SYSVOL"
|
||||||
DomainMode = "${domain_mode}"
|
DomainMode = $DomainMode
|
||||||
DomainName = $DomainName
|
DomainName = $DomainName
|
||||||
DomainNetBiosName = $DomainNetBiosName
|
DomainNetBiosName = $DomainNetBiosName
|
||||||
SafeModeAdministratorPassword = $SafeModePassword
|
SafeModeAdministratorPassword = $SafeModePassword
|
||||||
ForestMode = "${forest_mode}"
|
ForestMode = $ForestMode
|
||||||
InstallDns = $true
|
InstallDns = $true
|
||||||
Force = $true
|
Force = $true
|
||||||
}
|
}
|
||||||
|
|
||||||
Install-ADDSForest @HashArguments
|
Install-ADDSForest @HashArguments
|
||||||
|
|
||||||
|
|
||||||
Write-Output "AD DS installation complete. Domain created: $DomainName"
|
Write-Output "AD DS installation complete. Domain created: $DomainName"
|
Loading…
Reference in New Issue