{"id":1757,"date":"2020-04-23T19:01:45","date_gmt":"2020-04-24T01:01:45","guid":{"rendered":"http:\/\/www.RiptideHosting.com\/blog\/?p=1757"},"modified":"2020-04-25T09:12:20","modified_gmt":"2020-04-25T15:12:20","slug":"installing-the-remote-desktop-gateway-role-rdgw-on-windows-server-2019","status":"publish","type":"post","link":"https:\/\/www.RiptideHosting.com\/blog\/installing-the-remote-desktop-gateway-role-rdgw-on-windows-server-2019\/","title":{"rendered":"Installing the Remote Desktop Gateway Role (RDGW) on Windows Server 2019"},"content":{"rendered":"\n<p><strong>Installing the Remote Desktop Gateway Role (RDGW) on Windows Server 2019 to force RDP over HTTPS (port 443) instead of port 3389.<\/strong><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong><u>Installing Remote Desktop Gateway (RDGW) Role on Windows Server 2019<\/u><\/strong><\/p>\n\n\n\n<p>In this example, we had already installed the RD Session Host (RDSH) and RD License Server roles previously on the server. \u00a0This server is in workgroup mode and not joined to a domain.\u00a0 Steps below are used to install the RDGW role on a single server (installing RDGW also installs IIS) so all three roles (RDSH, RDlic, RDGW) are installed on the same server.  If you are already licensing RDS with RDS user licenses, there is no additional cost to installing the RD Gateway Role (other than if you purchase a trusted SSL certificate).<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Go to Server manager, add roles &amp; features, role-based or feature-based installation, select existing server, in Server roles expand Remote Desktop Services and select Remote Desktop Gateway, click through everything else as defaults. It will take about 5 minutes to install. Although it won\u2019t force a reboot, it is typically a good idea to reboot the server after this step.<img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"523\" class=\"wp-image-1758\" style=\"width: 700px;\" src=\"http:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/Installing-RD-Gateway.png\" alt=\"Installing RD Gateway\" srcset=\"https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/Installing-RD-Gateway.png 791w, https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/Installing-RD-Gateway-300x224.png 300w, https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/Installing-RD-Gateway-768x574.png 768w, https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/Installing-RD-Gateway-624x466.png 624w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/li><\/ol>\n\n\n\n<p>2.  Next go to Server Manager, Remote Desktop Services, Servers, click on server name and right click into properties and to \u201cRD Gateway Manager\u201d.&nbsp; (note: in RDS, Overview, you will see a message about needing to be logged in as domain user to manage servers and collections \u2013 to have this functionality you need to be connected to a domain instead of in workgroup mode, we are proceeding with workgroup mode only below).<img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"567\" class=\"wp-image-1759\" style=\"width: 700px;\" src=\"http:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/RD-Gateway-Manager.png\" alt=\"RD Gateway Manager\" srcset=\"https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/RD-Gateway-Manager.png 724w, https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/RD-Gateway-Manager-300x243.png 300w, https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/RD-Gateway-Manager-624x505.png 624w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n\n\n\n<p>3.  In RD Gateway Manager, expand tree and go to policies.&nbsp; Create a \u201cConnection Authorization Policy\u201d (CAP) for which users can login to the gateway and a \u201cResource Authorization Policy\u201d (RAP) for what resources can be accessed.&nbsp; For example, we created policies called CAP1 and RAP1 and used defaults for most everything.&nbsp; For CAP1, you probably want to add Remote Desktop Users and Administrators to \u201cuser group membership\u201d.&nbsp; For RAP1, under Network Resource, you should change selection to \u201callow users to connect to any resource\u201d since this is a single server setup.&nbsp; You can modify these policies later to be more specific and restrictive. <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"476\" class=\"wp-image-1761\" style=\"width: 700px;\" src=\"http:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/RDGW-CAP.png\" alt=\"RDGW CAP\" srcset=\"https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/RDGW-CAP.png 593w, https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/RDGW-CAP-300x204.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n\n\n\n<p>4.  For SSL cert (go back to RD Gateway Manager, Properties), create a self-signed cert by going to properties, SSL tab, create self-signed cert, click on \u201ccreate and import certificate\u201d, change certificate name to the IP address \u201cxxx.xx.xxx.xx\u201d of the server in the certificate name field. &nbsp;Copy the self-signed cert to your local PC because you will need it in order to login through the gateway (all users will need it).&nbsp; If you use a trusted SSL cert from CA then you won\u2019t need to install self-signed cert on each local PC\/client like you will with a self signed certificate.&nbsp; Take note of the self-signed certificate expiration date which should be in 6 months \u2013 if you decide to continue to use a self-signed certificate, you will need to generate a new cert before the expiration date.<\/p>\n\n\n\n<p>Note: using a self-signed certificate will require you to install the certificate on each client device. &nbsp;It is recommended to use a trusted cert (instead of self-signed cert) where you would need to purchase the SSL cert from a company like GoDaddy and it will be in the name of a URL\/domain instead of IP address.<img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"607\" class=\"wp-image-1762\" style=\"width: 700px;\" src=\"http:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/RDGW-properties-SSL-tab.png\" alt=\"RDGW properties SSL tab\" srcset=\"https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/RDGW-properties-SSL-tab.png 522w, https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/RDGW-properties-SSL-tab-300x260.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n\n\n\n<p>5.  At this point, all items in RD Gateway Manager status should be showing as green \/ green check marks.<img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"171\" class=\"wp-image-1763\" style=\"width: 700px;\" src=\"http:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/RDGW-status.png\" alt=\"RDGW status\" srcset=\"https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/RDGW-status.png 1035w, https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/RDGW-status-300x73.png 300w, https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/RDGW-status-1024x250.png 1024w, https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/RDGW-status-768x188.png 768w, https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/RDGW-status-624x153.png 624w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n\n\n\n<p>6.  Go to Services and change the Remote Desktop Gateway Service (service name is TSGateway) to be startup type \u201cautomatic\u201d instead of \u201cautomatic (delayed)\u201d and make sure it is started\/running.&nbsp; This will allow gateway service to start quicker upon a server reboot otherwise you may get a message that the gateway service is unavailable when trying to log in until you wait several minutes for the service to start.<img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"765\" class=\"wp-image-1764\" style=\"width: 700px;\" src=\"http:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/Change-RDGW-service-to-automatic.png\" alt=\"Change RDGW service to automatic\" srcset=\"https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/Change-RDGW-service-to-automatic.png 452w, https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/Change-RDGW-service-to-automatic-274x300.png 274w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong><u>Connecting to RDGW from your local PC<\/u><\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\"><li>7Open the Remote Desktop Connection client on your local PC and expand all field by clicking show options.<\/li><li>On the general tab, make sure computer name field is the IP address of the server.&nbsp; You will be entering the IP address on both the General tab and the Advanced tab using the same IP address since the RDSH server and the RDGW server are the same server in this example.<\/li><li>Before connecting, going to the Advanced tab<\/li><li>Click on Settings box under Connect from Anywhere<\/li><li>Select \u201cuse these gateway settings\u201d<\/li><li>Enter IP address of the server for Server Name<\/li><li>Uncheck the box to \u201cBypass RD gateway server for local addresses\u201d<\/li><li>Check the box to use same credentials for RD gateway server and remote computer since same server in this example<img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"425\" class=\"wp-image-1765\" style=\"width: 700px;\" src=\"http:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/Local-Connection-Client-Gateway-settings.png\" alt=\"Local Connection Client Gateway settings\" srcset=\"https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/Local-Connection-Client-Gateway-settings.png 948w, https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/Local-Connection-Client-Gateway-settings-300x182.png 300w, https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/Local-Connection-Client-Gateway-settings-768x467.png 768w, https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/Local-Connection-Client-Gateway-settings-624x379.png 624w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/li><li>Press OK, go back to local resources tab and select what local devices should be redirected (typically printers and clipboard should be redirected, but not local drives under the more button \u2013 redirecting local drives uses bandwidth\/resources so only do it when needed)<\/li><li>Go to general tab, decide if you want credentials to be allowed to be saved, and save the customized rdp file as a shortcut on your desktop by clicking \u201csave as\u201d and give it a useful name.<\/li><li>When you connect, you may first get a warning message that says \u201c<strong>The publisher of this remote connection can\u2019t be identified. Do you want to connect anyway? OR \u201cthe identity of the remote computer cannot be verified. Do you want to connect anyway?\u201d<\/strong> You can click the box to \u201cdon\u2019t ask me again for connections to this computer\u201d if you don\u2019t want to see this message every time, and continue.&nbsp; This message typically happens because you are using a rdp shortcut on your local desktop that you customized or because you are using a self-signed certificate.<\/li><li>Connect and you will get a message to enter your credentials which will be used for both RDSH and RDGW, select whether to remember credentials or not.<\/li><li>If you try to connect and you get a message \u201c<strong>This computer can\u2019t verify the identity of the RD Gateway XXXXX\u2026.<\/strong>\u201d and it won\u2019t connect, it is because you are using a self-signed certificate and haven\u2019t put a copy of the certificate in your trusted root certificate authorities on your local PC.&nbsp; So go back on the server and copy the cert from the users\\username\\documents\\certname.cer folder of server to you local PC\/desktop, then double click it on your local PC, select \u201cinstall certificate\u201d and select \u201cLocal Machine\u201d store location and select this specific location \u201cTrusted Root Certificate Authorities\u201d (don\u2019t do automatic location).&nbsp; THIS WILL HAVE TO BE DONE ON ALL LOCAL PCs TO CONNECT WHEN USING SELF-SIGNED CERTS.<\/li><li>If you are have trouble logging in, try typing username as servername\\username so WIN-XXXXXX\\Administrator or ServerX\\Dan etc.<\/li><\/ol>\n\n\n\n<p><strong><u>Turn off port 3389 to internet to force traffic to use port 443\/RDGW<\/u><\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\"><li>Next, turn off the four inbound Windows firewall rules for Remote Desktop for port 3389 FOR PUBLIC PROFILE (Remote Desktop \u2013 User Mode (TCP-In) and (UDP-In) and Remote Desktop Services \u2013 User Mode (TCP-In) and (UDP-In).&nbsp; Click into the firewall rule, go to the advanced tab, and uncheck the \u201cPublic\u201d box so the rule doesn\u2019t apply to the public profile.<img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"59\" class=\"wp-image-1766\" style=\"width: 700px;\" src=\"http:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/RDGW-firewall-rules.png\" alt=\"RDGW firewall rules\" srcset=\"https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/RDGW-firewall-rules.png 989w, https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/RDGW-firewall-rules-300x25.png 300w, https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/RDGW-firewall-rules-768x64.png 768w, https:\/\/www.RiptideHosting.com\/blog\/wp-content\/uploads\/2020\/04\/RDGW-firewall-rules-624x52.png 624w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/li><li>RDP Traffic then should go over port 443 from the outside to the server and then 3389 internal to the server.&nbsp; You can test this by trying to login via RDP without Gateway settings.<\/li><li>You can modify\/disable other Remote Desktop inbound firewall rules if needed too.<\/li><\/ol>\n\n\n\n<p><\/p>\n\n\n\n<p><strong><u>Additional Notes:<\/u><\/strong><\/p>\n\n\n\n<p>See different post on how to purchase and install a SSL certificate from a trusted CA.  <a href=\"http:\/\/www.riptidehosting.com\/blog\/purchasing-and-installing-a-trusted-ssl-certificate-to-use-for-rdgw-rdsh\/\" target=\"_blank\" rel=\"noreferrer noopener\">http:\/\/www.riptidehosting.com\/blog\/purchasing-and-installing-a-trusted-ssl-certificate-to-use-for-rdgw-rdsh\/<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installing the Remote Desktop Gateway Role (RDGW) on Windows Server 2019 to force RDP over HTTPS (port 443) instead of port 3389. Installing Remote Desktop Gateway (RDGW) Role on Windows Server 2019 In this example, we had already installed the RD Session Host (RDSH) and RD License Server roles previously on the server. \u00a0This server [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,15,99],"tags":[52],"class_list":["post-1757","post","type-post","status-publish","format-standard","hentry","category-all-posts","category-windows-server-2016","category-windows-server-2019","tag-remote-desktop"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.RiptideHosting.com\/blog\/wp-json\/wp\/v2\/posts\/1757","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.RiptideHosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.RiptideHosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.RiptideHosting.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.RiptideHosting.com\/blog\/wp-json\/wp\/v2\/comments?post=1757"}],"version-history":[{"count":3,"href":"https:\/\/www.RiptideHosting.com\/blog\/wp-json\/wp\/v2\/posts\/1757\/revisions"}],"predecessor-version":[{"id":1776,"href":"https:\/\/www.RiptideHosting.com\/blog\/wp-json\/wp\/v2\/posts\/1757\/revisions\/1776"}],"wp:attachment":[{"href":"https:\/\/www.RiptideHosting.com\/blog\/wp-json\/wp\/v2\/media?parent=1757"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.RiptideHosting.com\/blog\/wp-json\/wp\/v2\/categories?post=1757"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.RiptideHosting.com\/blog\/wp-json\/wp\/v2\/tags?post=1757"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}