AD域环境搭建

1. DC

Pasted image 20260125195423.png

1.1. 使用服务管理器安装 AD DS

在WinServer2012起,可以通过“服务器管理器”GUI界面 来安装AD DS

1.1.1. 修改机器名

首先为为我们的机器改一个合适的名字, 比如DC01,然后重启机器
Pasted image 20260404121910.png

1.1.2. 添加角色和功能

在服务器管理器中,选择“管理”并选择“添加角色和功能”以启动添加角色向导
Pasted image 20260404121647.png

然后选择要安装AD DS的机器的名字,这就选择的就是这条机器( DC01)
Pasted image 20260404122227.png

然后选择ADDS角色
Pasted image 20260404122412.png

然后下一步、下一步到这个界面,点击“安装”
Pasted image 20260404122526.png

1.1.3. 配置为域控

安装完成后,点击这里将这台机器配置为域控
Pasted image 20260404122650.png

然后选择添加一个新的林,并输入你的域名
Pasted image 20260404123037.png

然后设置DSRM密码
Pasted image 20260404123257.png

然后不需要配置DNS委派,直接下一步
Pasted image 20260404123353.png

然后配置一个NetBIOS name
Pasted image 20260404123555.png

然后路径默认即可,
Pasted image 20260404123633.png

一直下一步、然后点击安装,安装完成后就会自动重启计算机

1.2. 配置网卡

Pasted image 20260404125102.png

2. 使用powershell进行搭建

一些注意的地方:
Pasted image 20260419164508.png
这里选择标准版即可 (Core是cli界面,没有GUI的)
手动记得配置一下IP
Pasted image 20260419170307.png
域控配置

#重命名计算机
Rename-Computer -NewName "DC01" -Restart

#安装 Active Directory 域服务 Windows 功能及其管理控制台
Install-WindowsFeature -name AD-Domain-Services -IncludeManagementTools

#将服务器提升为域控
Install-ADDSForest -DomainName rain.local -skipprechecks

#禁用 DF 实时监控
Set-MpPreference -DisableRealtimeMonitoring $true

#禁用 Windows 防火墙
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False

#根据网络适配器并配置 DNS
Get-NetAdapter
Set-DnsClientServerAddress -InterfaceAlias "Ethernet0" -ServerAddresses 192.168.8.110

#验证DNS服务器配置是否正确
Get-DnsClientServerAddress

#安装 AD CS Windows 功能
Install-WindowsFeature ADCS-Cert-Authority -IncludeManagementTools

#配置企业根证书颁发机构
Install-AdcsCertificationAuthority `
  -CAType EnterpriseRootCA `
  -CryptoProviderName "RSA#Microsoft Software Key Storage Provider" `
  -KeyLength 2048 `
  -HashAlgorithmName SHA256 `
  -ValidityPeriod Years `
  -ValidityPeriodUnits 10 `
  -CACommonName "Rain-CA"

`#创建6个域用户帐户
net user c1trus Password@1 /add /domain
net user tao Password@1 /add /domain
net user bilir Password@1 /add /domain
net user eric Password@1 /add /domain
net user tom Password@1 /add /domain
net user hyh Password@1 /add /domain

#配置c1trus为域管
net group "Domain Admins" c1trus /add /domain

#将 tao 分配给备份操作员和远程管理用户
net localgroup "Backup Operators" tao /add
net localgroup "Remote Management Users" tao /add

客户端配置

#改名字
rename-Computer -NewName client

#配置DNS和网络适配器
Get-NetAdapter
Set-DnsClientServerAddress -InterfaceAlias "Ethernet0" -ServerAddresses 192.168.8.110

#将 Windows 10 客户端加入 rain.local 域
Add-Computer -DomainName rain.local -Restart