-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPromo-dc.ps1
30 lines (24 loc) · 1.15 KB
/
Promo-dc.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
### Install New Domain Controller Script ###
# Define DCPROMO parameters
$installationParams = @{
DatabasePath = "?F:\NTDS" # Path to the database
DomainName = "???.com" # Fully Qualified Domain Name (FQDN) of the domain
LogPath = "?F:\NTDS\Logs" # Path to the log files
SiteName = "???" # Name of the existing site
SysvolPath = "?F:\SYSVOL" # Path to the SYSVOL folder
NoGlobalCatalog = $false
CreateDnsDelegation = $false
Credential = Get-Credential # Prompts for user credentials with rights to add a domain controller
CriticalReplicationOnly = $false
InstallDns = $true
NoRebootOnCompletion = $false
Force = $true
}
# Check and install the ADDS role if it is not already installed
if (-not (Get-WindowsFeature AD-Domain-Services).Installed) {
Install-WindowsFeature AD-Domain-Services -IncludeManagementTools
}
# Import the necessary PowerShell module
Import-Module ADDSDeployment
# Install the domain controller into an existing domain
Install-ADDSDomainController @installationParams