Single Sign on for RDWeb on Server 2016

This guide will show you how to streamline your sign in experience so that users do not get any security prompts.

By default you might see the warning below every time you try to connect to a collection:

The Final Result


  1. Users enter their password into RD Web
    1. We will not be passing Windows credentials to the website automatically since it will not work from external computers, and it might cause some confusion.
  2. Users select their collection
  3. Users are now on their remote desktop (no other prompts)
You will also get a lock on your RDP bar confirming that the identity of the server was verified.

Requirements

  1. Server 2016 (Most of this should work on 2012)
  2. SSL certificate for one domain (Wildcard not required)
  3. Remote Desktop Gateway Role Deployed
  4. Windows workstations using Internet Explorer

My Test Environment

  • Server 2016
  • Single server handling RD Web, RD Gateway, RD Connection broker
  • 3 RD Session Host servers
  • Internal AD Domain name of example.LOCAL
  • External domain name example.COM
  • RDWeb URL: remote.example.com 

Assigning SSL certificate

Purchase an SSL certificate that corresponds with your external RDWeb URL. In my case it is remote.example.com. Assign this certificate to all of your deployment roles. Make sure that all roles say trusted.
Go to https://remote.example.com and make sure that you do not get any SSL warnings. 

Create DNS records and Test Connection

Create an internal (Active Directory) and an external DNS record that points remote.example.com to your remote desktop gateway server.

Test to make sure that you can connect to your RD Session Host Servers from inside and outside your network. You might get the error below, but we will get rid of it soon.

Removing the IE Add-in warning

We will be using IE which will eliminate one of the sign in prompts. But first we need to automatically enable the Remote Desktop Services Web Access Control add-on for all users. 

GPO

For computers on the domain, create a GPO with the following settings:
  • User Configuration/Preferences/Windows Settings/Registry
  • HKCU
  • Software\Microsoft\Windows\CurrentVersion\Policies\Ext\CLSID
  • {6A5B0C7C-5CCB-4F10-A043-B8DE007E1952}
  • REG_SZ
  • 1

Non Domain computers

For all other computers, you will need to run this command:


reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Ext\CLSID" /t REG_SZ  /v "{6A5B0C7C-5CCB-4F10-A043-B8DE007E1952}" /d 1

Remove Publisher warning


By default computers will not trust your Gateway as an RDP publisher.

Get the thumbprint of your certificate. You might have an invisible white space at the front so delete the first character and type it in again.

You will need to update this any time you renew your certificate.

GPO

  • User Configuration /Policies/Administrative Templates/Windows Components/Remote Desktop Services/Remote Desktop Connection Client/Specify SHA1 thumbprints of certificates representing trusted .rdp publishers
  • Enabled
  • Your thumbprint from earlier

Non Domain Computers

For all other computers, you will need to run this command:

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /t REG_SZ  /v "TrustedCertThumbprints" /d "THUMBPRINTgoesHERE"

Remove Certificate Name Mismatch Error

As you can see in the error above, the name on the certificate does not match our RDG server. This is also preventing us from getting the lock on the RDS bar.

  1. Open the Remote Desktop Gateway Manager MMC
  2. Go to %ServerName%/Policies/Resource Authorization policies
  3. Right click on the properties of RDG_AllDomainComputers
  4. Click on the Network Resources tab
  5. select "Allow users to connect to any network resource"
  6. Using the script found here change the published name of all RDP files.
  7. Try connecting to the RDS again. if it works then you can move forward. If you get an error like the one below then review all the steps. Worst case you can revert the changes by using the old RD Published Name.

Set Private Computer mode (optional)

To further reduce the number of clicks we will be setting all RD Web logins to "This is a private computer". Note, changing this will prevent the public setting from taking effect. 
  1. On your Gateway go to C:\Windows\Web\RDWeb\Pages\en-US
  2. Make a backup of Default.aspx
  3. Change bPrivateMode = false (Line 35 for me) to bPrivateMode = true
It might look like nothing changed on the website, but all new logins will be treated as private. Changing the radio button will no longer do anything.


Remove "Connect to a remote PC"

  1. Open IIS
  2. Go to %ServerName%/Sites/Default Web Site/RDWeb/Pages
  3. Click on Application Settings
  4. Set ShowDesktops to false


Since we set the network resources to unrestricted I will remove the option for users to connect to network PCs from the website.

All Done

We have new completed our SSO configuration. Users will not have to click through any warnings and they will be able to get to their RD Resources faster than before.

References


Comments

Popular posts from this blog

FSLogix Troubleshooting guide

Best Practices for Deploying User Profile Disks

Removing Application UAC Requirements with Shims