How to Setup Remote Desktop Connection Broker Load Balancing in Windows 2016

Updated on October 8, 2018

The tutorial will go through the steps of installing an additional RD Session Host Server, and how to deploy it as part of a Farm that hosts an application collection. It will show how to connect via Remote Desktop into the RD Session Host Farm from the internal network.

Accessing the RD Session Host Farm from an external network (e.g. internet) can be done through the use of the Remote Desktop Gateway. This will be discussed in another tutorial.

This tutorial requires that Remote Desktop Services for Windows 2016 be already installed. It will show how to add an additional RD Session Host server to the RD Session Host Farm.

Summary of Steps

The following is the list of steps required to setup load balancing between the RD Session Host servers.

  1. Plan the installation
  2. Setup Remote Desktop Services
  3. Install Remote Desktop Session Host Server on a 2nd Server
  4. Add the 2nd RD Session Host server to the Collection
  5. Configure Load Balancing
  6. Add DNS Entries for the RD Connection Broker Farm
  7. Testing Remote Desktop Connection Broker on the Internal Network
  8. Finished

Plan the Installation and Setup Remote Desktop Services

You will need to plan what servers will have the necessary roles to be installed.

We need servers for the following roles:

Remote Desktop Web Access
Remote Desktop Gateway
Remote Desktop Connection Broker
Remote Desktop Session Host (1st Server)
Remote Desktop Session Host (2nd Server)

Follow this related article to plan and install Remote Desktop Services in Windows 2016.

https://turbofuture.com/computers/How-to-Setup-Remote-Desktop-Services-Windows-2016

We will use the same server naming convention used in the related article and place the same corresponding roles on the servers.

Install the first Remote Desktop Session Host role on the RDSERVICES server.

Follow the below information to install the Remote Desktop Session Host role on the second server. The second server will be called RDSERVICES2.

Install the Remote Desktop Session Host Server Role on the 2nd Server

Install a Windows 2016 Server called RDSERVICES2 and join it to the domain.

Connect via Remote Desktop to the RDSERVICES server. This was the server we had used to configure Remote Desktop Services from the steps above.

On the RDSERVICES Server, launch Server Manager, and we will add RDSERVICES2 to be managed.

Click on Add other servers to manage
Click on Add other servers to manage
Enter the name RDSERVICES2 and click Find to locate it and add it to be managed
Enter the name RDSERVICES2 and click Find to locate it and add it to be managed

On the left hand pane of Server Manager, click on Remote Desktop Services.

Click on Add RD Session Host servers
Click on Add RD Session Host servers
Highlight RDSERVICES2, and click on the right arrow to select it. Click Next.
Highlight RDSERVICES2, and click on the right arrow to select it. Click Next.
Tick the Restart remote computers as needed option and click Add
Tick the Restart remote computers as needed option and click Add
You should now see RDSERVICES2 added to the Deployment Servers
You should now see RDSERVICES2 added to the Deployment Servers

Configure a Collection Across Multiple RD Session Host Servers

We will now configure the Applications1 collection (created in the related article on How To Setup Remote Desktop Services in Windows 2016) to also be hosted on RDSERVICES2.

Click on the Applications1 collection.

Click on the Applications1 Collection option.
Click on the Applications1 Collection option.

Scroll down to the Host Servers section. Currently only RDSERVICES is hosting the collection. We will now add RDSERVICE2 to also host the collection.

Select the Add RD Session Host Servers option from the Tasks menu.

Select RDSERVICES2 and click Next
Select RDSERVICES2 and click Next
Click Add
Click Add
Click Close
Click Close
RDSERVICES2 is now serving the Applications1 collection
RDSERVICES2 is now serving the Applications1 collection

Configure Load Balancing

We will now configure the load balancing settings for the Applications1 collection.

Scroll up to the Applications1 properties section.

Select Edit Properties from the Tasks menu.

Open up the load balancing section.

The current setting is Relative Weight 100 for both the RD Session Host servers. What this means is both servers will share the users remote desktop sessions 50-50.

You can increase (or decrease) the relative weight to control which servers will end up having more sessions.

If you want to drain a particular server of users if you are going to be doing maintenance on the server, use a value of 1 for the relative weight of that server, and keep your administrator account logged into that server. This means any new connections will be redirected to the second server. Existing connections will not be affected. As users log off, the server will be drained of user sessions so you can begin doing your maintenance.

Note: You cannot use a value of 0.

Bypassing Connection Broker

If you try to Remote Desktop to a server that's load balanced and you are using the server's name, you may get an error message. The reason is that the connection broker may try to redirect your session to a different server than the server that you initially tried to connect to. When this happens, you will get the following message:

Error redirecting when using server name
Error redirecting when using server name

However, there are times when you really do need to connect to a specific server in the farm. In this case, you will need to start up the Remote Desktop client with the "/a" switch. This can be typed in the command line or the run box.

e.g.

mstsc /a

This will launch the Remote Desktop client in administration mode, and it's session will not get redirected.

Add DNS Entries for the RD Connection Broker Farm

Following on from the above, where you will sometimes get an error message if you try to Remote Desktop into load balanced servers using one of the server's name, you will need to create DNS entries for the RD Farm. The DNS server should be enabled for round robin DNS. The RD Farm name can be anything you like, as long as it's accepted by the DNS server e.g. RDFarm. The reason why we need the DNS server to be enabled for round robin DNS is because we will have multiple entries for the RD Farm name, with each entry pointing to each server's IP address that is in the farm.

Ensure robin robin is enabled
Ensure robin robin is enabled

Navigate to the DNS zone, and create the DNS entries for the farm.

DNS Round Robin Load Balancing and Connection Broker

By using the farm DNS name for the server name in the Remote Desktop client, we are using DNS round robin to decide which RD session host server is going to have the initial connection. This is called DNS round robin load balancing.

Once the user has authenticated to the RD session host server in the farm, the server then contacts the connection broker to determine whether to continue with the login process or to redirect the connection to another RD session host server in the farm.

The connection broker firstly determines whether the authenticated user account has a disconnected session on one of the servers in the farm. If there is a disconnected session on one of the farm servers, the user will be re-directed to that session. If the user doesn't have a disconnected session in the farm, the broker uses the Session Collection Load Balancing settings to determine which server to redirect to.

An exception to the Session Collection Load Balancing settings, as mentioned previously, is if the remote desktop client was started from the command line or the run box with the "/a" option e.g. mstsc /a .

Testing Remote Desktop Connection Broker on the Internal Network

To connect to the farm, use the DNS name of the farm for the computer name in the Remote Desktop client.

To test if the connection broker is doing it's job, we can adjust the relative weight of the server that we have just connected to in the farm to 1.

In the above example, we have connected to the RDServices server. We will adjust the relative weight for it to 1. We can then remote desktop into the farm using a second user account and we should see it connect to the second server.

Use another account to log into the farm
Use another account to log into the farm
A warning about the computer identity will pop up. Just connect anyway.
A warning about the computer identity will pop up. Just connect anyway.
Check the name of the server to confirm that you have now logged into the second server
Check the name of the server to confirm that you have now logged into the second server

If you have a disconnected user session or even a non-disconnected user session on a server in the farm, the connection broker will redirect your connection to this session if you try to log in as that same account.

To test this, we can remote desktop to the farm as the account that’s currently logged into the RDServices server. Despite the relative weight being 1, the connection broker will redirect the user to the RDServices server.

Summary

We have now completed creating a Remote Desktop Session Host Farm, serving an Application Collection, and managed by the Remote Desktop Connection Broker.

We can connect to the RD Farm on the internal network.

© 2018 sengstar2005

Comments

    0 of 8192 characters used
    Post Comment

    No comments yet.

    working

    This website uses cookies

    As a user in the EEA, your approval is needed on a few things. To provide a better website experience, turbofuture.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

    For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: https://turbofuture.com/privacy-policy#gdpr

    Show Details
    Necessary
    HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
    LoginThis is necessary to sign in to the HubPages Service.
    Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
    AkismetThis is used to detect comment spam. (Privacy Policy)
    HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
    HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
    Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
    CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
    Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
    Features
    Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
    Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
    Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
    Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
    Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
    VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
    PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
    Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
    MavenThis supports the Maven widget and search functionality. (Privacy Policy)
    Marketing
    Google AdSenseThis is an ad network. (Privacy Policy)
    Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
    Index ExchangeThis is an ad network. (Privacy Policy)
    SovrnThis is an ad network. (Privacy Policy)
    Facebook AdsThis is an ad network. (Privacy Policy)
    Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
    AppNexusThis is an ad network. (Privacy Policy)
    OpenxThis is an ad network. (Privacy Policy)
    Rubicon ProjectThis is an ad network. (Privacy Policy)
    TripleLiftThis is an ad network. (Privacy Policy)
    Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
    Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
    Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
    Statistics
    Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
    ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
    Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)