PSM - After enrolling the target server to use RDP SSL using a CA-cert, RDP still presents the self-signed certificate

PSM - After enrolling the target server to use RDP SSL using a CA-cert, RDP still presents the self-signed certificate

340
Created On 11/10/26 11:01 AM - Last Modified 11/10/26 13:04 PM


Symptom


When connecting to the target server using PSM. the target server is presenting a self-signed certificate.

User-added image


Environment


Target server is part of the domain.

NOTE: Applies to Windows Server 2012
 


Cause


Sometimes RDS removes the certificate binding for static certificates

Resolution


On the target server run certlm.msc

Make sure the CA issued certificate is in the Personal Certificates store and the Remote Desktop Certificates store. Open the certificate and navigate to the details tab.
Scroll down and take note of the Thumbprint value

Using a Power Shell windows in Admin-mode run the following line by line:

$path = (Get-WmiObject "Win32_TSGeneralSetting" -ComputerName "WIN-VATCF3CS7N7.localdomain.local" -Namespace root\cimv2\terminalservices -Filter "TerminalName='RDP-tcp'").__path

Set-WmiInstance -Path $path -argument @{SSLCertificateSHA1Hash="162bb6b1b51b9a4309a047250a05b7881e98039c"}

Replace WIN-VATCF3CS7N7.localdomain.local with the common name in the certificate
Replace 162bb6b1b51b9a4309a047250a05b7881e98039c with the Thumbprint value of your certificate (without spaces)

Output:

__GENUS                                : 2
__CLASS                                : Win32_TSGeneralSetting
__SUPERCLASS                           : Win32_TerminalSetting
__DYNASTY                              : CIM_ManagedSystemElement
__RELPATH                              : Win32_TSGeneralSetting.TerminalName="RDP-Tcp"
__PROPERTY_COUNT                       : 20
__DERIVATION                           : {Win32_TerminalSetting, CIM_Setting, CIM_ManagedSystemElement}
__SERVER                               : WIN-VATCF3CS7N7
__NAMESPACE                            : root\cimv2\terminalservices
__PATH                                 : \\WIN-VATCF3CS7N7\root\cimv2\terminalservices:Win32_TSGeneralSetting.TerminalN
                                         ame="RDP-Tcp"
Caption                                :
CertificateName                        : WIN-VATCF3CS7N7.localdomain.local
Certificates                           : {0, 0, 0, 0...}
Comment                                :
Description                            :
InstallDate                            :
MinEncryptionLevel                     : 2
Name                                   :
PolicySourceMinEncryptionLevel         : 0
PolicySourceSecurityLayer              : 0
PolicySourceUserAuthenticationRequired : 0
SecurityLayer                          : 1
SSLCertificateSHA1Hash                 : 162BB6B1B51B9A4309A047250A05B7881E98039C
SSLCertificateSHA1HashType             : 3
Status                                 :
TerminalName                           : RDP-Tcp
TerminalProtocol                       : Microsoft RDP 8.0
Transport                              : tcp
UserAuthenticationRequired             : 0
WindowsAuthentication                  : 0
PSComputerName                         : WIN-VATCF3CS7N7

Refer to https://support.microsoft.com/en-sg/help/3042780/remote-desktop-listener-certificate-configurations-in-windows-server-2 for more information.
 


Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj0000001T1bCAE&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail