Restore Default Certificate Deployment Level for RemoteApp (Windows Server 2012 R2)

This guide details how to change the certificate deployment level of a Windows Server 2012 R2 RD system from “Trusted” back to the default configuration of “Not Configured.”    The main problem is that the Windows GUI does not allow you to simply delete the trusted certificate and reset it back to the default “Not Configured” state for the deployment certificate level. Instead the GUI will only let you choose a different certificate (whether trusted or self signed). The steps below will get around this limitation and allow you to reset the deployment level.

First set of steps are to delete any existing Remote Desktop certificates and have Windows generate a new one automatically:

  1. Launch mmc.exe on the 2012 R2 server
  2. Choose File-Add/Remove Snap in
  3. Add Certificates -> choose Computer account -> then Local computer. Click OK.
  4. On left hand side browse to Remote Desktop folder -> Certificates folder
  5. Delete all certificates
  6. Launch services.msc
  7. Restart Remote Desktop Configuration service
  8. In Event Viewer – System, you should see a notification that a new self signed certificate was created
  9. Go back to mmc.exe and at the top choose Action-Refresh.
  10. Confirm new certificate is shown in Remote Desktop folder -> Certificates folder
  11. Close mmc.exe. Choose No if it prompts to save.

The next set of steps are to change the deployment level:

There is one registry key that needs to be modified:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\CentralPublishedResources\PublishedFarms\[NAME_OF_YOUR_FARM]\DeploymentSettings]

fHasCertificate – REG_DWORD set to a value of 0

Under this same key there is also a CertificateHash – REG_BINARY that contains thumbprint of the old certificate. It can probably be deleted but I have left it in place until it causes a problem.

There is a second key at the following location

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\

with a key titled CertExpiryTracking and under it a key with a title equal to the old certificate thumbprint with a LastPeriodLogged REG_DWORD decimal value of 15.  The entire CertExpiryTracking key can probably be deleted but I have left it in place until it causes a problem.

Now you will need to connect to the Windows Internal Database:

  1. Download and install Microsoft SQL Server Management Studio (SSMS) v17 or higher
  2. Launch SSMS
  3. Connect to internal database using this server name:
  4. Navigate to Databases -> RDCms -> and select rds.DeploymentSetting
  5. Right click on it then choose Edit Top 200 Rows
  6. Rename the following items:
    1. RedirectorCertificate – > RedirectorCertificate.bak
    2. PublishingCertificate -> PublishingCertificate.bak
    3. DeploymentCertificateHash -> DeploymentCertificateHash.bak
    4. WebAccessCertificate -> WebAccessCertificate.bak
  7. Close SSMS
  8. Close and reopen any Server Manager windows. Then go back and check that deployment certificate level is now showing as Not Configured.

Also if you were using a trusted certificate in IIS you may need to change the certificate for RDWeb by following these steps:

  1. Launch IIS Manager
  2. Right click Default Web Site, choose Edit Bindings
  3. Select https, click Edit
  4. Choose the appropriate SSL certificate in the dropdown list
  5. Restart IIS
This entry was posted in Uncategorized. Bookmark the permalink.