In this post I will go step by step to include everything you need to do to build an RDS farm that will include x2 RDS Broker Server, x2 RDS Session Hosts and x1 SQL Server.  I will go over how to achieve HA for the entire environment and what you will need to do to get everything up and running.

Design Overview

For this deployment I want to use the below:

2x RDS Broker Server

2x RDS Session Hosts

Users are to connect to the RDS Broker Servers as below and then redirected to the RDS Session Hosts.  From there they can then connect to other target servers.

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-Design

As the clients will be connecting to the RDS Broker Servers we need to add DNS Round Robin for the RDS Broker Servers in DNS.  For example we have rdsbroker1.domain.com with IP 10.10.20.10 and rdsbroker2.domain.com with IP 10.10.20.11.  We would add a new DNS name for the RDS Broker Cluster of:

rdsbrokercluster.domain.com IP 10.10.20.10

rdsbrokercluster.domain.com IP 10.10.20.11

In Microsoft DNS please ensure DNS Round Robin is also enabled.

Installing the RDS Server Roles

First do a basic installation of Windows Server 2019 Standard on x5 servers.  Once your servers are ready all we need to add all of the servers into one single console for the RDS deployment.

Open the Server Manager and click 3. Add other servers to manage

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-1




Add in all the soon to be broker and session host servers and click ok

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-2

Click 4. Create a server group, give it a name and add the soon to be RDS servers to it and click ok

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-3

Here is the group, click on it

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-4

You will see all the RDS servers available

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-5




The deployment of an RDS infrastructure is facilitated by the tool built into the server managers, in a single command the following roles will be installed:
• Remote Desktop Session Host
• Broker
• Remote Desktop Access via the Web

From server manager click add roles and features

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-6

Click next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-7

Select Remote Desktop Services installation and click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-8

Select a standard deployment and click next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-9

Select session-based deployment and click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-10




Click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-11

Add the first broker server and click Next (we will add the second in later when we configure HA)

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-12

Select install the RD Web Access role on the RD connection broker

Select the session host and click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-13

Add the RD Session host servers and click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-14

Confirm is all ok and select Restart if required, click Deploy

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-15

Roles are deployed

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-16

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-17

Create a collection to specify the hosts and who can access them
Open server manager and click Remote Desktop Services, click collections and click Create Session Collection

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-18

Click next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-19




Name the collection

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-20

Select your session host servers and click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-21

Add the groups that are allowed to login to the host servers

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-22

Enter path of user profile disk folder (the NTFS and share permissions must allow full control for the RDS server AD objects – we will come back to this later)

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-23

Confirm all is correct and click create

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-24

Configurations are applied

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-25

Select the collection and click Tasks, Edit properties

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-26

Edit the session properties so that sessions can expire

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-27

Select the security options

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-28

Select any server weighting

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-29

Configure client settings and click ok

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-30

Open RDS Licensing

 

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-31

Add the license servers (I used the session hosts)

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-32

Click Add

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-33

Licensing configuration is applied

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-34

Right click on RD Licensing and click select RD licensing mode

 

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-35




Select the license mode and click Apply> Ok

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-36

 

From the session host where we install the license server role click Tools> Remote Desktop Services> Remote Desktop Licensing Manager

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-37

Right click and Activate server

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-38

Select Automatic Connection

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-39

Enter company details

 

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-40

Enter email

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-41

Click Next to add licenses

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-42

Select Enterprise Agreement

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-43

Enter agreement number

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-44

Enter license details and click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-45

License is installed

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-46

Go to License server and open RDS License Console.  Right click license server and click Review configuration

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-47




Click add to group

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-48

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-49

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-50

Repeat on any additional license servers (I split 50:50 between my session hosts)

Preparing for the RDS Broker HA Configuration

First we need to create the user profile disk folder on a server and share.  This needs to be highly available so I store mine on a replicated DFS folder.  On a file server create a folder for RDS profiles and share. The RDS session hosts need full control.

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-51

Do the same for NTFS permissions

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-52

Create AD security group and add broker servers

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-53

For the purpose of this guide and because we do not want to focus on SQL too much we will just use a standalone SQL Express database.  However for highly available setups the best solution is to use Always On Availability Groups as in my guide here.

Next Setup new 2019 server and install SQL Express, I used SQL Server Express 2019 (latest available).   Install SQL Management Studio and login. Then add a new login for RDS servers

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-54

Click search

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-55

Select the RDS Server Broker group

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-56

Select dbcreator in roles

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-57

Login is added to the list

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-58

Click New Database

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-59

Name the database

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-60

Database is added

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-61

Modify the login you created to make it db owner

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-62

On the RDS servers install the SQL client from the install media

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-63

Next on your SQL servers add the broker server accounts to the Remote Management Users group

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-95

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-96

Configure RDS Broker Servers for HA

Go to RDP Overview and right click the connection broker, then click Configure High Availability

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-64

Click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-65

Select dedicated database server

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-66

Enter RDS broker cluster name and input connection string and click next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-67

The connection string I used for this setup is:

DRIVER=SQL Server Native Client 11.0;SERVER=VMMGTRDSSQL101;Trusted_Connection=Yes;APP=Remote Desktop Services Connection Broker;DATABASE=RDSHA

 

If you are using multiple subnets and SQL Availability Groups, your string should look more like the below – using the DNS name of your SQL listener

DRIVER=SQL Server Native Client 11.0;SERVER=aglinuxrds;MultiSubnetFailover=True;Trusted_Connection=Yes;APP=Remote Desktop Services Connection Broker;DATABASE=RDSHA

 

If this doesn’t work try this, MultiSubnetFailover=Yes changes from True at one of the client versions

DRIVER=SQL Server Native Client 11.0;SERVER=aglinuxrds;Trusted_Connection=Yes;MultiSubnetFailover=Yes;APP=Remote Desktop Services Connection Broker;DATABASE=RDSHA;

 

If you have any problems at this stage first check your SQL server is listening on port 1433

Powershell (from the SQL server)

tnc 127.0.0.1 -port 1433

 

If not, open SQL configuration manager and click SQL Server Network Configuration>Protocols>TCP/IP and ensure the right IPs are enable and port 1433 is added as below

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-68

Click Configure

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-69

The task is executed, click close

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-70

Adding a broker server

From the deployment overview Right click on the RD Connection Broker click add RD Connection Broker Server

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-71

Click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-72

Add the second RDS Broker server and click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-73

Click Add

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-74




The wizard should complete

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-75

If you have any issues at this stage connecting to the database check the SQL server log

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-76

I was seeing this

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-77

Check that the logins are still applied as db_owner – for some reason mine had dropped out even though it was definitely set and worked for the first server

Here is a PowerShell script you can use to test your SQL connection (Should just return True or False)

function Test-SQLConnection
{        [OutputType([bool])]    Param    (        [Parameter(Mandatory=$true,                    ValueFromPipelineByPropertyName=$true,                    Position=0)]        $ConnectionString    )    try    {        $sqlConnection = New-Object System.Data.SqlClient.SqlConnection $ConnectionString;        $sqlConnection.Open();        $sqlConnection.Close();
        return $true;    }    catch    {        return $false;    } }
  Test-SQLConnection "DRIVER=SQL Server Native Client 11.0;SERVER=VMMGTRDSSQL101;Trusted_Connection=Yes;APP=Remote Desktop Services Connection Broker;DATABASE=RDSHA" 

 

Create a certificate to secure the connection to the RDS Broker server

Open IIS on the RDS Broker server and go to Server Certificates

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-79

Click Create New Certificate Request> Make bit length 2048

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-80

Save the request file

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-81

Click Finish

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-82

Go to the certificate authority server and issue the certificate using the request file from the RDS Broker.  Simply open the command line and enter the following:

certreq -submit -attrib "CertificateTemplate:WebServer" wintelbastionreq.txt

 

Save the certificate output as a .cer file and copy it back onto the RDS Broker.

Go to IIS again and Server Certificates, then click complete certificate request.  Select the .cer file you just collected from the CA and select the Personal Store.

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-83




Open the certificate console by going to Start>Run certlm.msc

You will see the certificate installed in the personal computer store

 

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-84

Right click on the certificate and click Export

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-85

Select .PFX and click Next

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-86

Specify a password and select SHA256

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-88

Save the .pfx file

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-89

Go back to the RDS Deployment Overview> Select Tasks> Properties> Certificates. Click Select existing certificate and enter the path to the .pfx file you just saved and enter the password you specified

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-90

The certificate is deployed to both RDS Broker servers and now used to secure the connection

How to Build an RDP Farm in with Windows 2019 Using RDS Broker HA and RDS Session Hosts-91

Connecting clients to RDS Broker

I just wanted to use a normal RDP connection for clients to connect to the brokers and then be redirected to the session hosts.  To do this first you need to check the below registry entry:

Check registry entry for your collection (may differ to actual collection name).  Mine was as below:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\CentralPublishedResources\PublishedFarms\Domain_-_Wintel_Bas

 

Copy collection name from registry.

Create an .rdp file open in Notepad and add these lines to it:

use redirection server name:i:1
loadbalanceinfo:s:tsv://MS Terminal Services Plugin.1.Domain_-_Wintel_Bas full address:s:WINTELBASTION.DOMAIN.COM

 

Brokers should now redirect to Sessions hosts