Installing an SSL certificate on an RDP service using PowerShell commands is an easy and convenient way to provide secure remote desktop access on your server. You will definitely have to do this if you are using a TerminalServer farm (a session-based terminal server farm). In this article, we will look at how to install an SSL certificate on an RDP service using PowerShell commands.
Step 1: Creating a certificate request and installing it (this article will not consider it.).
Step 2: Install certificate on RDP service
Now we can install the certificate on the RDP service. For this:
- Open the MMC snap-in and in the "Certificates" snap-in for "Local Computer" in the "Personal" section, open the certificate installed earlier.
- In the "Composition" tab, find the "Imprint" item (it's "
Thumbprint
") and copy it (useful in the next step.) - Open PowerShell in administrator mode and run the following command:
$path = (Get-WmiObject -class "Win32_TSGeneralSetting" -Namespace root\cimv2\terminalservices -Filter "TerminalName='RDP-tcp'").__path Set-WmiInstance -Path $path -argument @{SSLCertificateSHA1Hash="Thumbprint"}
<Thumbprint
> replace with the thumbprint of the certificate installed in step 2 point 3.
Restarting the OS and service is not required.