Alright, so I’ve wanted to setup a Remote Desktop Gateway for years, but the configuration seemed so.. time-intensive. Then I moved to Belgium, my living situation changed and I didn’t want to setup a whole new VPN server to access my virtual lab.
Initially, I set up my RD Gateway using too many Remote Desktop Services: Remote Desktop Connection Broker, Remote Desktop Gateway & Remote Desktop Web Access, but that was because was lead astray by Windows 2012′s new GUI. Now, I’ve narrowed it down only to RD Gateway and I’m even fond of Metro (:O)
So to get this going, all you have to do is install and configure the Remote Desktop Gateway Services (RD Gateway) Role. That seems obvious, but Server Manager’s interface which prominently displays an unconfigured “Remote Desktop Services” tab made me think I was missing something.
Then click Next a bunch of times. Something odd, when it asks you “Do you need an alternate source path?”, even if you have the Windows Server 2012 ISO attached, you’ll still need to click “Specify an alternate source path” and enter D:\sources\sxs (assuming your ISO is attached to D:)
Click Install and wait for the installation to complete. Now it’s time to configure RD Gateway.
OPTIONAL: If you’re on a domain with a Certificate Authority, you’ll want to configure IIS to use a Domain Certificate. Open IIS Manager -> Select your server -> Server Certificates -> Create Domain Certificate. For “Common Name” make sure you enter your external FQDN. Note: I chose to go with dyndns.org since I have a dynamic IP. It’s required that you use an externally resolvable hostname, otherwise Remote Desktop will fail if you try to use an IP or mismatched hosts.
Click View or modify certificate properties. If you don’t have a Domain Certificate, just click Create and import certificate and ensure you use your external FQDN for the certificate name. Otherwise, choose Select an existing certificate…. Choose your certificate
Click Import -> Apply. Now that you’re back at the RD Gateway Manager, expand the tree under your server name. Click Policies then on the right, click Create Authorization Polices for RD Gateway. Create an RD CAP and RD RAP (Recommended). In the name field, you can enter whatever you’d like. I chose “Default” -> Next -> Add Group -> Domain Admins -> (leave Client Computer blank)
Next, you’ll be given the option to Enable or Disable Device Redirection. I just choose the default (all clients) and click Next -> Next -> Next – Default -> Next -> Allow users to connect to any network resource -> Next -> Allow Connections only to port 3389 -> Next -> Finish
Finally, open up Services and Start Remote Desktop Gateway
Voila! Now you can go modify your router rules to connect port 443 to your RD Gateway Server and/or read the important notes below.
A few important things to note
As an added security pre-caution, I went into IIS and disabled Anonymous access to my root IIS folder and ensured Windows Authentication was still enabled for the RPC folders.
Enter the external hostname that you entered earlier during the configuration of RD Gateway. Go back to the general tab, and enter the FQDN of the domain server you wish to connect to. Don’t worry about resolving the hostname if you’re using an external DNS server — DNS is resolved at the RD Gateway so if the RD Gateway can resolve the hostname, you’re set.
If you choose to use a self-signed cert or you are attempting to connect from a computer that’s not on the domain, you’ll have to import the SSL cert to your Trusted Root Certification Authority. Otherwise, you’ll receive the error “This computer can’t verify the identity of the RD Gateway ‘sample.server.com’. It’s not safe to connect to servers that are not identified. Contact your network administrator for assistance.”
There are a few ways to do this, but here’s how I do it. I use Chrome to hit my server (ex. https://myserver.dyndns.org)
Click Certificate Information -> Details -> Copy to File. Save the cert, then find it using Windows Explorer. Right-click on the cert -> Install Certificate -> Place all Certificate in the Following Store -> Trusted Root Certification Authority -> Next -> Finish -> Yes.
You should now be able to connect and securely manage your network, all over SSL :)