Import Certificate to RD

#server-2012, #en, #server-2012-r2, #rds edit this page

With Server 2012 the MMC “Remote Desktop Session Host Configuration” doesn’t exist anymore. If you want to import a specific certificate to the RD Session Host you can do the following:

1. Import the certificate to the machines personal store

image

2. Then use the following commands to import the certificate to the Session Host:

$pass = ConvertTo-SecureString “CERTIFICATE-PASSWORD” -AsPlainText –Force
$thumbprint = (Import-PfxCertificate -Password $pass -CertStoreLocation cert:\localMachine\my -FilePath '\\LocationToCertificate\certificate.pfx').thumbprint
$path = (Get-WmiObject -class "Win32_TSGeneralSetting" -Namespace root\cimv2\terminalservices -Filter "TerminalName='RDP-tcp'").__path
Set-WmiInstance -Path $path -argument @{SSLCertificateSHA1Hash="$Thumbprint"}

Now the certificate is imported.

Greetings
dn