Windows Server 自带的 DirectAccess 本身不直接支持多因素认证(MFA),但可以通过 整合 Active Directory + NPS(网络策略服务器)+ RADIUS 或 Azure AD 来实现。以下是几种常见的方式:
安装 NPS(网络策略服务器)
配置 DirectAccess 服务器使用 NPS 进行身份验证
启用 OTP(一次性密码)
Enable-DAOTPAuthentication
以启用 OTP 支持。✅ 适用于 本地 AD,无需 Azure。
✅ 结合 智能卡、OTP(动态密码),提高安全性。
✅ 适合已有 NPS + RADIUS 方案的企业。
❌ 部署复杂,涉及多个服务器组件。
❌ 需要额外的 OTP 服务器或智能卡。
将本地 AD 同步到 Azure AD
在 Azure AD 配置 MFA
在 DirectAccess 服务器启用 Azure AD 认证
✅ 云端管理,支持 Microsoft Authenticator、短信验证码等。
✅ 策略灵活,可针对不同用户设置不同级别的 MFA 认证。
✅ 适用于 企业计划未来向云端发展。
❌ 需要 Azure AD P1/P2 许可证,增加成本。
❌ 本地 AD 需要同步到 Azure,涉及额外配置。
如果不想使用 Windows 内置方案,也可以集成第三方 MFA 解决方案:
这些方案通常都可以通过 RADIUS/NPS 方式 整合到 DirectAccess,实现双因素认证。
方案 | 适用场景 | 认证方式 | 复杂度 | 额外成本 |
---|---|---|---|---|
NPS + RADIUS + OTP | 纯本地 AD,已有 NPS 服务器 | OTP、智能卡 | 中等 | 低 |
Azure AD + Conditional Access | 企业已使用 Azure AD,想用云端 MFA | Microsoft Authenticator、短信 | 高 | 需要 Azure AD P1/P2 |
第三方 MFA(Duo, RSA, Okta) | 需要更强的 MFA 选项 | 手机验证码、硬件令牌 | 中等 | 取决于供应商 |
如果企业主要在 本地部署 Windows 域环境,建议 使用 NPS + RADIUS + OTP,这样无需依赖 Azure,而且可以直接与 DirectAccess 结合。
✅ 第一步:安装 NPS(网络策略服务器)
✅ 第二步:配置 RADIUS 认证
✅ 第三步:部署 OTP 服务器(Windows 内置方案)
✅ 第四步:配置 DirectAccess 服务器使用 OTP 认证
✅ 第五步:测试与优化
NPS(Network Policy Server)是 Windows Server 内置的 RADIUS 服务器,负责身份验证。
1️⃣ 打开 Windows Server,启动 “服务器管理器”。
2️⃣ 选择 “添加角色和功能” → “基于角色或基于功能的安装”。
3️⃣ 在 服务器角色 选择 “网络策略和访问服务”,然后勾选 “网络策略服务器(NPS)”。
4️⃣ 点击 下一步 → 安装,等待安装完成。
1️⃣ 在 服务器管理器,点击 “工具” → “网络策略服务器”。
2️⃣ 在 NPS 控制台,右键 “NPS(本地)” → 选择 “注册到 Active Directory”。
3️⃣ 确保 NPS 服务器有域管理员权限,然后确认注册。
DirectAccess 服务器需要通过 RADIUS 服务器(NPS) 进行身份验证。
1️⃣ 在 NPS 控制台,展开 RADIUS 客户端和服务器,右键 “RADIUS 客户端” → 新建。
2️⃣ 输入 DirectAccess 服务器信息:
DirectAccess-Server
1️⃣ 在 NPS 控制台,展开 策略 → 右键 “连接请求策略” → 新建。
2️⃣ 设置策略名称:如 DirectAccess-Connection
。
3️⃣ 条件:
DirectAccess 服务器支持 Windows OTP(一次性密码),但需要额外安装和配置 OTP 服务。
1️⃣ 在 DirectAccess 服务器 上,打开 PowerShell(管理员权限)。
2️⃣ 运行以下命令启用 OTP 认证:
Enable-DAOTPAuthentication
3️⃣ 服务器会自动安装 OTP 组件,并提示你**需要 AD 证书服务(AD CS)**来颁发 OTP 证书。
1️⃣ 安装 AD 证书服务(CA):
2️⃣ 创建 OTP 认证模板:
1️⃣ 在 DirectAccess 服务器,打开 远程访问管理控制台。
2️⃣ 进入 DirectAccess 配置向导,选择 身份验证 → 启用 OTP 认证。
3️⃣ 在 OTP 设置中:
1️⃣ 打开 PowerShell(管理员权限)。
2️⃣ 运行以下命令:
Set-DAOtpAuthentication -RadiusServer "NPS_Server_IP" -SharedSecret "YourRadiusSecret"
3️⃣ 确保 RADIUS 和 OTP 服务正常运行:
Get-DAOTPAuthentication
如果返回 Enabled
,说明 OTP 认证已启用。
1️⃣ 在客户端(Windows 10/11 企业版):
2️⃣ 使用 Microsoft Authenticator / OTP 令牌测试
✅ DirectAccess + NPS + RADIUS + OTP 可实现基于 Windows 本地的多因素认证,提升远程访问安全性。
✅ 无须 Azure,适合本地 AD 企业环境。
✅ 支持智能卡、OTP 令牌、手机验证码等 MFA 认证方式。
✅ 基于 Active Directory 管理,与 Windows 域无缝集成。
使用软件 OTP 方案(如 Microsoft Authenticator、Google Authenticator)来实现 DirectAccess + MFA,可以提升安全性,同时避免硬件令牌的额外成本和维护。
✅ 在 Windows Server 上配置 DirectAccess,并集成 OTP 动态密码
✅ 让 员工使用手机 APP(Microsoft Authenticator、Google Authenticator) 生成 OTP
✅ 通过 NPS + RADIUS 认证 实现 Windows 远程访问的双因素认证(MFA)
1️⃣ 安装 NPS(已完成,可跳过)
2️⃣ 创建 RADIUS 认证策略
DirectAccess-OTP-Policy
Windows Server 提供内置 OTP(一次性密码)认证支持,但需要额外配置。
1️⃣ 在 DirectAccess 服务器上启用 OTP 认证
Enable-DAOTPAuthentication
2️⃣ 配置 OTP 服务器
Set-DAOtpAuthentication -RadiusServer "NPS_Server_IP" -SharedSecret "YourRadiusSecret"
3️⃣ 配置 OTP 令牌验证
1️⃣ 在 Windows 10/11 设备上,运行:
Get-DAConnectionStatus
确保 DirectAccess 连接状态正常。
2️⃣ 登录 Windows 远程访问时,系统会提示 OTP:
✅ 采用软件 OTP(手机 APP)认证,避免硬件令牌成本
✅ 基于 Windows Server + RADIUS 实现 MFA,增强 DirectAccess 远程访问安全性
✅ 支持 Microsoft Authenticator、Google Authenticator,适配多种设备
✅ OTP 结合 Active Directory 证书(AD CS)可进一步增强安全性