qidao123.com技术社区-IT企服评测·应用市场

标题: VMware Workstation 部署企业级 AD 域、DNS、DHCP 体系操作指南 [打印本页]

作者: 伤心客    时间: 2025-5-22 08:01
标题: VMware Workstation 部署企业级 AD 域、DNS、DHCP 体系操作指南
一、主机环境规划

1. 虚拟机设置表
主机角色
操作体系
IP 地址
子网掩码
DNS
内存
硬盘
网络模式
域控制器 (DC)
Windows Server 2022
192.168.1.10
255.255.255.0
192.168.1.10
4GB
体系盘:60GB
NAT/桥接
DHCP 服务器
Windows Server 2022
192.168.1.20
255.255.255.0
192.168.1.10
2GB
体系盘:50GB
NAT/桥接
客户端测试机
Windows 10/11 企业版
DHCP 分配
255.255.255.0
192.168.1.10
2GB
体系盘:40GB
NAT/桥接

2. 软件版本

二、部署步骤

1. 创建虚拟机

2. 安装操作体系
powershell
New-NetIPAddress -InterfaceAlias "Ethernet0" -IPAddress 192.168.1.10 -PrefixLength 24 -DefaultGateway 192.168.1.1
Set-DnsClientServerAddress -InterfaceAlias "Ethernet0" -ServerAddresses 192.168.1.10
powershell
New-NetIPAddress -InterfaceAlias "Ethernet0" -IPAddress 192.168.1.20 -PrefixLength 24 -DefaultGateway 192.168.1.1
Set-DnsClientServerAddress -InterfaceAlias "Ethernet0" -ServerAddresses 192.168.1.10

3. 部署 Active Directory 域服务 (AD DS)
powershell
# 安装 AD 域服务和 DNS
Install-WindowsFeature AD-Domain-Services, DNS -IncludeManagementTools
 
# 提升为域控制器并创建新林
Install-ADDSForest -DomainName "corp.example.com" -DomainNetbiosName "CORP" -InstallDNS -Force
powershell
# 检查 DNS 正向剖析区域
Get-DnsServerZone -Name "corp.example.com"
 
# 测试域名剖析
nslookup dc01.corp.example.com 192.168.1.10

4. 部署 DHCP 服务器
powershell
Install-WindowsFeature DHCP -IncludeManagementTools
powershell
# 添加作用域
Add-DhcpServerV4Scope -Name "MainScope" -StartRange 192.168.1.100 -EndRange 192.168.1.200 -SubnetMask 255.255.255.0
 
# 设置选项
Set-DhcpServerv4OptionValue -DnsServer 192.168.1.10 -Router 192.168.1.1
powershell
Add-DhcpServerInDC -DnsName "dhcp01.corp.example.com" -IPAddress 192.168.1.20

5. 客户端加入域并测试
powershell
Add-Computer -DomainName "corp.example.com" -Credential (Get-Credential CORP\Administrator) -Restart
powershell
# 查看客户端 IP 设置
ipconfig /all
 
# 测试 DNS 剖析
ping dc01.corp.example.com

三、日常运维操作

1. AD 域管理
powershell
# 创建用户
New-ADUser -Name "John.Doe" -SamAccountName "johndoe" -AccountPassword (ConvertTo-SecureString "@ssw0rd" -AsPlainText -Force) -Enabled $true
 
# 创建组并添加成员
New-ADGroup -Name "IT_Admins" -GroupScope Global
Add-ADGroupMember -Identity "IT_Admins" -Members "johndoe"
cmd
gpupdate /force

2. DNS 管理
powershell
# 添加 A 记录
Add-DnsServerResourceRecordA -Name "webserver" -ZoneName "corp.example.com" -IPv4Address 192.168.1.50
 
# 清算过期记录
Clear-DnsServerCache -Force

3. DHCP 管理
powershell
# 查看地址池使用环境
Get-DhcpServerv4ScopeStatistics -ScopeId192.168.1.0
 
# 开释过期租约
Remove-DhcpServerv4Lease -IPAddress192.168.1.101
powershell
# 导出 DHCP 设置
Export-DhcpServer -File"C:\DHCP_Backup.xml" -Leases
 
# 恢复设置
Import-DhcpServer -File"C:\DHCP_Backup.xml" -BackupPath "C:\DHCP_Backup"

4. 数据备份与恢复
powershell
# 使用 WindowsServer Backup
Install-WindowsFeatureWindows-Server-Backup
wbadmin start systemstatebackup-backupTarget:E:

5. 服务器监控
powershell
# 监控 CPU/内存
Get-Counter -Counter"\Processor(_Total)\% Processor Time", "\Memory\AvailableMBytes"
 
# 监控 AD 复制状态
repadmin /showrepl

四、协同工作机制

1. 跨服务依赖
2. 自动化脚本
powershell
# 检查 AD 复制状态
repadmin /replsummary
 
# 检查 DNS 服务
Get-Service DNS
 
# 检查 DHCP 作用域
Get-DhcpServerv4ScopeStatistics

五、注意事项

1. 安全加固
2. 故障排查
问题现象
   
排查命令
   
修复步骤
   
客户端无法加入域
  
Test-ComputerSecureChannel -Repair
  
检查 DNS 剖析和网络连通性
  
DHCP 地址池耗尽
  
Get-DhcpServerv4ScopeStatistics
  
扩展作用域范围或缩短租约时间
  
DNS 剖析失败
  
Resolve-DnsName dc01.corp.example.com
  
检查 DNS 记录和服务器状态
  

3. 维护周期


免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。




欢迎光临 qidao123.com技术社区-IT企服评测·应用市场 (https://dis.qidao123.com/) Powered by Discuz! X3.4