Skip to content

Instantly share code, notes, and snippets.

@stknohg
Created September 9, 2015 12:47
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 stknohg/3e535e883dab4b67a1f0 to your computer and use it in GitHub Desktop.
Save stknohg/3e535e883dab4b67a1f0 to your computer and use it in GitHub Desktop.
ドメインに追加のドメインコントローラーを昇格させるスクリプト
#
# Install ADDS/GPMC/RSAT(ADTools) Components
#
Add-WindowsFeature AD-Domain-Services, GPMC, RSAT-ADDS, RSAT-AD-PowerShell
#
# Install New Domain Controller
#
Import-Module ADDSDeployment
$DomainName = "contoso.local"
$Cred = New-Object PSCredential "administrator@$DomainName",(ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force)
$Params = @{
Credential = $Cred;
DomainName = $DomainName;
SiteName = "Default-First-Site-Name";
DatabasePath = "C:\Windows\NTDS";
LogPath = "C:\Windows\NTDS";
SysvolPath = "C:\Windows\SYSVOL";
ReplicationSourceDC = "";
NoGlobalCatalog = $false;
CriticalReplicationOnly = $false;
SafeModeAdministratorPassword = (ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force);
InstallDns = $true;
CreateDnsDelegation = $false;
NoRebootOnCompletion = $false;
Confirm = $false;
}
Install-ADDSDomainController @Params
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment