RDS 许可故障排除指南

试用我们的虚拟代理 - 它可以帮助您快速识别并解决常见的远程桌面许可问题

本文列出的资源可以帮助您解决远程桌面服务 (RDS) 的许可问题。

故障排除清单

宽限期

在长达120天的许可宽限期内,不需要许可证服务器。 Once the grace period ends, clients must have a valid RDS CAL issued by a license server before they can log on to an RD Session Host server. 如需了解更多信息,请参阅以下文章:

The current grace period on a computer can be read by running the following command:

wmic /namespace:\\root\CIMV2\TerminalServices PATH Win32_TerminalServiceSetting WHERE (__CLASS !="") CALL GetGracePeriodDays

或者通过运行以下 PowerShell 命令:

$obj = gwmi -namespace "Root/CIMV2/TerminalServices" Win32_TerminalServiceSetting
$obj.GetGracePeriodDays()

重置宽限期:宽限期可以重置为120天。 However, we don't recommended this approach. 相反,您必须实施一个许可证服务器以及一个许可证包。

验证配置在远程桌面会话主机(RDSH)服务器上的许可证服务器和当前许可模式。

要做到这一点,请运行以下 PowerShell 命令:

$obj = gwmi -namespace "Root/CIMV2/TerminalServices" Win32_TerminalServiceSetting
$obj.GetSpecifiedLicenseServerList()
$obj.LicensingType

LicensingMode values

Set the method for how the license server and the licensing mode will be applied on the RDSH server

您可以使用以下任何一种方法来实现此配置。

使用图形用户界面

Use the RDMS GUI that's started on the active broker. This configuration is stored in the following registry values:

注册表子键: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\Licensing Core
注册表值:LicensingMode

注册表子项:Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermService\Parameters\LicenseServers
注册表值:SpecifiedLicenseServers

使用本地策略

The gpedit.msc console can be used to configure the following policy locally on the server:
计算机配置>策略>管理模板>Windows组件>远程桌面服务>远程桌面会话主机>许可

  • 使用指定的远程桌面许可证服务器。
  • 设置远程桌面的许可证模式。

这些数值存储在以下注册表项中:

注册表子项: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services
注册表值:

  • LicenseServers
  • LicensingMode

注意

This configuration will apply before the one that's mentioned in "Using GUI". 这意味着当配置了本地策略时,“使用 GUI”配置将无效,因为注册表值不会被考虑在内。 在这种情况下,您不能使用 RDSM 配置许可证服务器和许可模式。

使用基于 Active Directory 域的组策略

This method is similar to "Using local policy." The only difference is that this configuration is set by using a GPO that's configured in an Active Directory domain:
计算机配置 > 策略 > 管理模板 > Windows 组件 > 远程桌面服务 > 远程桌面会话主机 > 许可
配置设置远程桌面许可模式策略。

策略配置存储在会话主机服务器的以下注册表项中:

Registry subkey: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services
Registry values:

  • LicenseServers
  • 许可模式

注意

  • 该配置将在“使用 GUI”中提到的配置之前应用。这意味着当本地策略已配置时,“使用 GUI”配置将不起作用,因为注册表值将不会被考虑。 在这种情况下,您不能使用RDSM来配置许可证服务器和许可模式。
  • 在会话主机服务器上启动的 gpedit.msc 控制台在此配置中不会出现。

Check the configuration on the license server

To do this, start the Remote Desktop Licensing Manager console on the licensing server, and then do the following:

  • Check whether the licensing server is activated.

  • Review the configuration to verify that the scope is correct.

  • 确保授权服务器已添加到“终端服务器许可证服务器”域组中。

  • 设置许可证服务器和许可证模式的配置应用方式:

    • Use the steps in bullet item 2 to check what the session host server sees. 请查看项目符号3中给出的注册表配置,以确定配置的设置方式。
    • 如果存在 GPO,这意味着服务器上已经设置了参数。 即使gpedit.msc显示了一个配置,该配置也不会被使用。
  • Check whether the Group Policy Object is applied by running the following command:
    gpresult /H ?:\fileName.html

  • 检查最小TCP端口。

    Verify that the minimal TCP ports are open. 如需获取更多信息,请参见RD Licensing Network Port Requirements

  • 利用事件日志确定许可证服务器的行为。

    • 在许可服务器上启动事件查看器。
    • 访问 Application and Services Logs\Windows\TerminalServices-Licensing\Operational
    • 以下文章包含了一份远程桌面服务事件的列表,这些事件可能会出现在安装了 RD 许可角色服务的计算机的事件日志中。
      Remote Desktop Licensing

常见问题及解决方案

WVD 在出现错误代码 0x80070057 后,将在 60 分钟后被注销。

Windows 虚拟桌面 (WVD) 用户因许可证无效和许可错误 0x80070057 而在 60 分钟后被注销。

为了解决这个问题,请重新部署主机池,以便重置宽限期。 这是唯一支持的解决方法。

RDLS在请求Windows Server 2019 CAL时,在Windows Server 2016上停止响应。

远程桌面授权服务(RDLS)在请求 Windows Server 2019 客户端访问许可证(CALs)时,在 Windows Server 2016 上停止响应。

配置 Windows Server 2019 的远程桌面会话主机 (RDSH) 使用 Windows Server 2016 的远程桌面授权服务器 (RDLS) 是不支持的。 Windows Server 2016 版本的 RDLS 无法发布或处理 Windows Server 2019 RDS 许可证。 此问题已在 RDLS 2012 R2 中解决。 在RDLS 2019中没有发生这种情况。

在远程桌面授权管理器中,报告日期显示为“未知”

此问题已在更新KB 4457127中得到解决。

数据收集

如果您需要微软支持的帮助,我们建议您按照使用 TSS 收集用户体验问题信息中提到的步骤收集信息。

Prerequisites

  1. TSS必须由具有本地系统管理员权限的账户运行,并且必须接受EULA(接受EULA后,TSS将不会再次提示)。
  2. 我们建议使用本地计算机的RemoteSigned PowerShell 执行策略。

注意

当前的 PowerShell 执行策略不允许运行 TSS,请采取以下措施:

  • 通过运行 PS C:\> Set-ExecutionPolicy -scope Process -ExecutionPolicy RemoteSigned 设置 RemoteSigned 进程级别的执行策略。
  • 要验证更改是否生效,请运行 cmdlet PS C:\> Get-ExecutionPolicy -List
  • 由于进程级权限只适用于当前的PowerShell会话,一旦关闭运行TSS的PowerShell窗口,分配给进程级的权限将恢复到先前配置的状态。

在联系微软支持之前收集关键信息

  1. Download TSS on all nodes and unzip it in the C:\tss folder.

  2. 从提升权限的PowerShell命令提示符打开 C:\tss 文件夹。

  3. Start the traces on the client and the server by using the following cmdlets:

    注释

    Run these traces simultaneously on the client, Session Host server(s) and licensing server(s).

    • Client:

      TSS.ps1 -scenario Net_RDScli
      
    • 服务器:

      TSS.ps1 -scenario Net_RDSsrv
      

    If you get many security warnings related to the execution policy while running the script, run the Set-ExecutionPolicy -ExecutionPolicy Bypass -force -Scope Process cmdlet to bypass those warnings.

  4. Respond to the EULA prompt.

  5. Allow recording (Video), and enter Y.

  6. 当脚本在客户端和服务器上都显示Reproduce the issue and enter 'Y' key AFTER finishing the repro时,开始重现问题。

  7. Enter Y to finish the log collection after the issue is reproduced.

The traces will be stored in a zip file in the C:\MS_DATA folder, which can be uploaded to the Microsoft workspace for analysis.

参考文献