Forcing the Remote Desktop option in TS Web Access to use TS Gateway

Forcing the Remote Desktop option in TS Web Access to use TS Gateway

  • Comments 3
  • Likes

Hi, my name is Mark Ghazai and I am a Support Escalation Engineer on the Performance team.  Today, we’re going to discuss how to modify the Remote Desktop option on the Windows Server 2008 TS Web Access page.  This has been a fairly common question over the last few months.  In particular, many of our customers have asked how they can force connections through the TS Gateway.  Contrary to popular belief, making this configuration change is not as difficult as you might have thought …

Here’s the screen shot of Remote Desktop Option under TS Web Access page – if you’ve been using Windows Server 2008 TS Web Access, you are already familiar with this page:

clip_image002

In the TechNet article listed at the end of this post, there are instructions on how to specify the TSGateway for this Remote Desktop Connection (see the screen shot below):

clip_image004

Observing the TS Web Access behavior, you can see that IIS ASP application automatically detects if the user is on the local or external network.  If the user is on the local network, the web application will bypass the TSGateway by default.  But, what if you want to route all Remote Desktop connections using this option through your TSGateway server regardless of location?  With a fairly simple page modification, this can be done;

  1. In the Internet Information Services (IIS) Manager Console, navigate to the TS folder under the Default Web Site.  This is the default path, you’ll need to navigate to the custom path if you’ve customized the TS Web Access site settings.
  2. Right Click on the TS and select Explore option.
  3. Windows Explorer should open that Web page folder associated with TS Web Access website.
  4. Navigate to the \Web\TS\en-US
  5. Edit the Desktops.aspx file using a text editor such as Notepad.

    clip_image006

  6. Modify the following section in the Desktops.aspx file and Save it.  NOTE: I would highly recommend making a backup of this file … just in case!

    clip_image008

  7. This change will take effect as soon as you restart the web site in the IIS Manager Console.  Making this change will force the Remote Desktop to be routed through TSGateway server (by default port 443) on all clients regardless of their location.

And that brings us to the end of our post.  Hopefully this helps answer some of your questions in this regard.  Until next time …

Additional Resources:

- Mark Ghazai

Share this post :
Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • where can i get help to fix my media player

  • Made the changes you suggested as we are experiencing the same thing, but i now just get a repeating login box ....

    Any ideas ?

    Regards

    Glenn

  • This worked perfect for me, thanks! This allows me to install the Web Access and TS Gateway on the same server and be able to use the Web Access over the internet to access my Terminal Servers on a private network. This also works for Server 2012 but the file path to the Desktops.aspx is slightly different.

    I also had to configure the Remote Desktop Web Connection behavior:

    "technet.microsoft.com/.../cc731465.aspx"

    Great work. Thanks again!