使用 PowerShell 安装 Active Director

2022-07-06  本文已影响0人  夙小叶
2022_07_06_15_33_40.png

当前环境:Windows Server 2016

安装 ADDSDeployment 和 DNS

Install-WindowsFeature -Name AD-Domain-Services, DNS -IncludeManagementTools

设置静态 IP

Jump 使用 PowerShell 配置静态 IP

安装 Active Directory

设置 SafeMode Admin Password

$Password = Read-Host -Prompt 'Enter SafeMode Admin Password' -AsSecureString

安装

Install-ADDSForest -CreateDnsDelegation:$false -DatabasePath "C:\Windows\NTDS" -DomainMode WinThreshold -DomainName "hcorp.local" -DomainNetbiosName "hcorp" -ForestMode WinThreshold -InstallDns:$true -LogPath "C:\Windows\NTDS" -NoRebootOnCompletion:$true -SafeModeAdministratorPassword $Password -SysvolPath "C:\Windows\SYSVOL" -Force:$true

或者

$Params = @{
  CreateDnsDelegation = $false
  DatabasePath = 'C:\Windows\NTDS'
  DomainMode = 'WinThreshold'
  DomainName = 'hcorp.local'
  DomainNetbiosName = 'hcorp'
  ForestMode = 'WinThreshold'
  InstallDns = $true
  LogPath = 'C:\Windows\NTDS'
  NoRebootOnCompletion = $true
  SafeModeAdministratorPassword = $Password
  SysvolPath = 'C:\Windows\SYSVOL'
  Force = $true
}

Install-ADDSForest @Params
上一篇 下一篇

猜你喜欢

热点阅读