Skip to content

Instantly share code, notes, and snippets.

@stknohg
Last active October 13, 2020 00:14
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/f71c1d58180d7280b71e to your computer and use it in GitHub Desktop.
Save stknohg/f71c1d58180d7280b71e 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
#
# Create new Forest/Domain
#
Import-Module ADDSDeployment
$Params = @{
DomainName = "contoso.local";
DomainNetbiosName = "CONTOSO";
ForestMode = "Win2012R2";
DomainMode = "Win2012R2";
DatabasePath = "C:\Windows\NTDS";
LogPath = "C:\Windows\NTDS";
SysvolPath = "C:\Windows\SYSVOL";
SafeModeAdministratorPassword = (ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force);
InstallDns = $true;
CreateDnsDelegation = $false;
NoRebootOnCompletion = $false;
Confirm = $false;
}
Install-ADDSForest @Params
# Windows Server 2016 - 2019 版
#
# Install ADDS/GPMC/RSAT(ADTools, DNS) Components
#
Add-WindowsFeature AD-Domain-Services, GPMC, RSAT-ADDS, RSAT-AD-PowerShell, RSAT-DNS-Server
Import-Module ADDSDeployment
$Params = @{
DomainName = "corp.contoso.com";
DomainNetbiosName = "CORP";
ForestMode = "WinThreshold";
DomainMode = "WinThreshold";
DatabasePath = "C:\Windows\NTDS";
LogPath = "C:\Windows\NTDS";
SysvolPath = "C:\Windows\SYSVOL";
SafeModeAdministratorPassword = (ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force);
InstallDns = $true;
CreateDnsDelegation = $false;
NoRebootOnCompletion = $false;
Confirm = $false;
}
Install-ADDSForest @Params
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment