美文网首页
使用 PowerShell 安装 Active Director

使用 PowerShell 安装 Active Director

作者: 夙小叶 | 来源:发表于2022-07-06 21:50 被阅读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
  • CreateDnsDelegation: 创建 DNS 委托
  • DomainMode: 创建新林中第一域的域功能级别。INFO
  • ForestMode: 指定新林的林功能级别。INFO
  • InstallDns: 安装并配置新林的 DNS服务器服务
  • NoRebootOnCompletion: 在完成此命令后是否立即重新启动计算机

相关文章

网友评论

      本文标题:使用 PowerShell 安装 Active Director

      本文链接:https://www.haomeiwen.com/subject/drtubrtx.html