这是 windows/ad-cs.md 的每次改动内容,按时间从新到旧。其他文章一起提交的部分不会出现在这里。
#1
2026-10-18
+70
−0
docs: 网络进阶(MSTP/ACL/NAT/PBR)、Linux 进阶(模块/性能/bonding)、Windows 进阶(DFS/DHCP/AD CS)
42afade
new file mode 100644
@@ -0,0 +1,70 @@
+---
+tags: [AD CS, 证书服务, Windows]
+order: 150
+---
+
+# AD CS 证书服务
+
+## 场景
+
+内网一堆系统要 HTTPS,不想每台都自签,也不想年年买证书。
+
+## 前置条件
+
+- 域环境,企业管理员权限
+- 一台独立服务器(别装在域控上)
+- 规划好 CA 名称,装完改不了
+
+## 配置
+
+```powershell
+# 1. 装企业根 CA
+Install-WindowsFeature -Name AD-Certificate, ADCS-Cert-Authority -IncludeManagementTools
+
+Install-AdcsCertificationAuthority -CAType EnterpriseRootCa `
+ -CACommonName "Corp-Root-CA" -KeyLength 2048 -HashAlgorithm SHA256 `
+ -ValidityPeriodYears 20 -Force
+
+# 2. 装 Web 注册(方便申请证书)
+Install-WindowsFeature -Name ADCS-Web-Enrollment -IncludeManagementTools
+Install-AdcsWebEnrollment -Force
+
+# 3. 申请 Web 服务器证书
+$inf = @"
+[NewRequest]
+Subject = "CN=kb.corp.local"
+KeyLength = 2048
+KeyAlgorithm = RSA
+ProviderName = "Microsoft RSA SChannel Cryptographic Provider"
+RequestType = PKCS10
+[Extensions]
+2.5.29.17 = "{text}DNS=kb.corp.local&DNS=www.kb.corp.local"
+"@
+certreq -new web.inf web.req
+certreq -submit web.req web.cer
+```
+
+## 验证
+
+```powershell
+Get-CACrlDistributionPoint
+certutil -CAInfo
+certutil -ping
+```
+
+浏览器打开 `http://ca.corp.local/certsrv` 能申请证书。
+
+## 回滚
+
+```powershell
+Uninstall-AdcsCertificationAuthority -Force
+```
+
+## 坑
+
+- **CA 名称装完不能改**,想清楚再装。
+- 根 CA 私钥丢了整个 PKI 报废,务必备份。
+- CRL 分发点不可达,证书校验会失败。
+- 装在域控上会拖慢登录,也会带来安全风险。
+- 证书模板权限没配,普通用户申请不了。
+- 服务器时间不对,签出来的证书直接无效。