大网数据广告活动
远程桌面与会话

Use certificates in Remote Desktop Services

· 52CE 我爱测

How to create and use authentication certificates for Remote Desktop Services.

You can use certificates to secure connections to your Remote Desktop Services (RDS) deployment and between RDS server roles. RDS uses Secure Socket Layer (SSL) or Transport Layer Security (TLS) to encrypt connections to the RDS Web, Connection Broker, and Gateway role services.

Certificates prevent man-in-the-middle attacks, where a bad actor intercepts traffic between the Remote Desktop Protocol (RDP) server and client to steal confidential information or deny access to credentials, by verifying that the server sending information to the client is authentic. When this trust relationship is set up, the client considers the connection secure and can accept data going to and from the server.

Prerequisites

The following are required to use certificates in RDS:

  • A computer or computers where the RDS role is configured. To learn more, see Install or uninstall roles, role services, or features.

  • An account with administrator rights or equivalent to one or more RDS servers.

  • A server certificate that meets the following requirements:

    • Issued for Server Authentication (EKU 1.3.6.1.5.5.7.3.1).

    • Issued for Enhanced Key Usage (OID 2.5.29.37).

    • Issued for Key Usage (OID 2.5.29.15).

    • Issued by a certificate authority trusted by one or more RDS servers and clients.

    • Issued with an exportable private key.

    • An export of the certificate with the corresponding private key in .pfx format. To learn more about exporting the private key, see Export a certificate with its private key.

Note: If you're using Active Directory Certificate Services (AD CS) to issue certificates, you can also create a certificate template or duplicate the Web Server certificate template. To learn more about creating certificate templates, see Create a new certificate template.

Configure Remote Desktop to use certificates

Now that you created your certificates and understand their contents, you must configure Remote Desktop to use those certificates.

To configure Remote Desktop to use specific certificates:

GUI

  1. In Server Manager, on the left pane, select Remote Desktop Services.

  2. On the Overview tab, under Deployment Overview, select TASKS, then select Edit Deployment Properties.

  3. In the Configure the deployment window, select Certificates.

  4. Choose Select existing certificate, select Browse, locate your certificate file in .pfx format, then select Open.

  5. In the Password field, enter the password for the certificate you created, then select OK.

  6. Select the Allow the certificate to be added to the Trusted Root Certification Authorities certificate store on the destination computers checkbox, then select OK.

  7. Select OK to finalize your deployment.

Note: Even if you have multiple servers in the deployment, Server Manager imports the certificate to all servers. Server Manager places the certificate in the trusted root for each server, then binds the certificate to its respective roles.

PowerShell

  1. Sign on to a computer with the RDS Remote Server Administration Tools (RSAT) installed and the RD role you wish to configure.

  2. Open an elevated PowerShell session.

  3. Run the following script for the RD certificate you plan to use for your session where it prompts you for the password and location for the exported certificate. Replace <PathToPFXFile> with the full file path including the .pfx file.

$password = Read-Host -AsSecureString -Prompt "Enter Password"
$parameters = @{
  Role        = "RDWebAccess"
  Password    = $password
  ImportPath  = "PathToPFXFile"
}
Set-RDCertificate @parameters

To set the certificate based on a specific -Role type, see Set-RDCertificate.

To view all of the configured RDS certificates, run the following command:

Get-RDCertificate

You might want to use certificates for the RDS Session Host along with the certificates you configured in Server Manager. For more information about RDS Session Host certificates, see Remote Desktop listener certificate configurations.

Related content

Source: Microsoft Learn / Windows Server documentation by Microsoft and contributors (upstream author metadata: robinharwood). Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Server documentation
适用范围
Windows Server · Source date 07/14/2025
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。