部署域服务,新建林和DnsServer.

修改计算机名称,修改完成重启。

Rename-Computer -NewName "H2019-DC01" -Restart

安装活动目录域服务及管理工具;

新建林并安装DNSServer服务,林和域级别 2012R2

Install-WindowsFeature AD-Domain-Services -IncludeManagementTools

Install-ADDSForest -DomainName "corp.contoso.com" -InstallDNS -DomainMode Win2012R2 -ForestMode Win2012R2

# Install-ADDSForest WinSer 2019 Syntax
# NAME
# Install-ADDSForest
#
# SYNTAX
# Install-ADDSForest -DomainName <string> [-SkipPreChecks] [-SafeModeAdministratorPassword <securestring>]
# [-CreateDnsDelegation] [-DatabasePath <string>] [-DnsDelegationCredential <pscredential>] [-NoDnsOnNetwork]
# [-DomainMode {Win2008 | Win2008R2 | Win2012 | Win2012R2 | WinThreshold | Default}] [-DomainNetbiosName <string>]
# [-ForestMode {Win2008 | Win2008R2 | Win2012 | Win2012R2 | WinThreshold | Default}] [-InstallDns] [-LogPath
# <string>] [-NoRebootOnCompletion] [-SkipAutoConfigureDns] [-SysvolPath <string>] [-Force] [-WhatIf] [-Confirm]
# [<CommonParameters>]

# Example: Install a new forest and a DNS delegation
# Install-ADDSForest -DomainName "corp.contoso.com" -CreateDNSDelegation -DomainMode Win2008R2 -ForestMode Win2008R2 -DatabasePath "d:\NTDS" -SysvolPath "d:\SYSVOL" -LogPath "e:\Logs"

PowerShell 部署域服务新建林_添加AD 域服务




Quoting:​​https://learn.microsoft.com/en-us/powershell/module/addsdeployment/install-addsforest?view=windowsserver2022-ps​