An RDS Gateway server is useful for allowing secure access to an RDS environment for Internet users.
A Remote Desktop Services (RDS) Gateway server uses an SSL certificate to encrypt the communication between the clients and the RDS servers.
IIS is used for authentication and to configure policies to granularly define which users should have access to what resources.
This guide assumes that an RDS deployment (containing the RDS Connection Broker, Licensing, and Session Hosts roles) already exists.
For more information about setting up basic or advanced RDS deployment, see Dell KB article 217251 How To - Standard Remote Desktop Services Deployment - Step by Step. Another article to view is KB article 215230 Install and Activate an RDS Session Host without a Connection Broker (Workgroup) - Windows Server 2022.
On the Windows Server computer that hosts the Connection Broker role for the RDS deployment, In Server Manager, click Manage then Add Roles and Features. Click Next on the Welcome Screen.
Click Add Features to install the prerequisites and then Next until the confirmation screen and then click Install.
Wait for it to finish installing and then click Close.
Back in Server Managers of the Connection Broker, in the Remote Desktop Services node, click the green circle with the plus sign above RD gateway.
Select the server that is configured as the RD Gateway. Move it to the right side and click Next.
Enter the FQDN of the RD Gateway Server. (This step configures the subject on the Self-Signed certificate created by this wizard. This is not the certificate that is used in this guide.). Click Next.
Click Add to confirm the addition to the deployment, wait for it to finish installing the role and then click Close.
Still in Server Manager, in the Connection Broker, under Deployment Overview, click Tasks and then Edit Deployment Properties.
Click on the Certificates node.
Important!
For testing purposes, it is possible to use a self-signed certificate created here or like the certificate that was automatically created earlier in the wizard. However, a production RDS environment should be configured to use a certificate from a trusted public or domain-based certification authority.
This guide demonstrates how to configure a certificate from a trusted public certification authority. That way, this certificate does not have to be installed on the client computers.
Click Select an existing certificate. Enter the path to the certificate. In this demo, the certificate has been copied to the root of the C:\ drive in the domain controller. Enter the password with which it was saved.
Click to check the "Allow the certificate to be added to the Trusted Root Certification Authorities certificate store on the destination computers" checkbox and click Ok.
Notice the Ready to Apply state in the deployment configuration screen. Click Apply.
After a few moments, the screen shows that the operation was completed successfully, and the level column recognizes the certificate as "Trusted."
Click the RD Web Access role and repeat steps 13-16 to configure it. That way that same certificate is used for IIS. Click Ok to exit the deployment configuration screen.
Before users can connect to the deployment using the RD Gateway server, it is required to configure a CAP and a RAP.
A Connection Authorization Policy (CAP) allows you to specify WHO is permitted to connect to the RDS Gateway Server.
A Resource Authorization Policy (RAP) allows you to specify WHAT servers or computers the authorized users have access to.
On the RDS Gateway server, open Server Manager, click Tools, Remote Desktop Services, and then Remote Desktop Gateway Manager.
Right-click the server name (RDSFARM in the image) and then click Properties.
Under the Server Farm tab, add the name of the RD gateway server (again, RDSFARM in the image) and click Apply.
Ignore the error about a load balancer. It is expected. Click Ok, Apply one more time and the status now shows OK.
In the SSL certificate tab, it is possible to view and change the certificate configuration of the RD gateway server. Even create a new self-signed certificate if needed. All this, however, has already been configured in the connection broker.
Click Ok to exit out of the properties screen.
Back in the main screen of RD Gateway Manager, expand the server and then policies.
Right-click Connection Authorization Policies then click Create New Policy and then Wizard.
Select Create an RD CAP and an RD RAP (recommended). Click Next.
Enter a name for the RD CAP. Click Next.
Click Add Group and enter the name of the group containing the users that are allowed to connect. Domain Users are used for this guide image. Click Next.
Leave the defaults in the Device Redirection and Session Timeout steps, clicking Next on both screens as well as in the Summary screen and then proceed with the RD RAP.
Enter a Name, click Next. Leave the default in the User Group section, Click Next again.
In the Network Resource screen, if there is an active directory group containing the computer accounts of the Session Hosts servers of this RDS deployment, specify it. Otherwise, select "Allow users to connect to any network resource (computer)" option. Click Next.
Leave the default port of 3389 for intranet gateway to RDS session hosts communication. Click Next.
Click Finish in the summary screen and then Close.
The RDS Gateway server is ready to be placed beyond the firewall, facing the Internet users. A user trying to connect to the RDS session hosts from a home or remote office location over the Internet must go through this RDS Gateway server first.
To connect to the RDS deployment using the newly configured RD Gateway, on the Remote Desktop Connection app of the client machine, enter the name of the RD Session Host or the target machine.
Click on the Show Options button, Advanced tab and, on the Connect from Anywhere section, Click Settings.
Click the "Use these RD Gateway server settings" ratio button and enter the public DNS name of the RDS Gateway.
Click OK and Connect. Enter the domain username and password for the RD Gateway Server and the target Session Host. The connection should succeed.
Back in the RDS Gateway machine, In RD Gateway Manager and under Monitoring, the connection details are visible.