Enable smart sizing in RDP through Remote Desktop Services 2012R2 Web Access


A quick post about a very interesting question from one of our customers: Can you please enable smart sizing when accessing Full Desktops or VDIs which we published using RDS 2012 R2 Web Access?

As you can see in the next screenshot, smart sizing is not available by default when you resize the Remote Desktop Connection window:
27 RDS Web Access Smart Sizing 03
It clearly shows a non-scaled desktop, complete with scroll bars.
I can see how this can be annoying.

And actually smart sizing is really simple to achieve.

As always, backup c:\windows\web\rdweb before making any changes!!

That said, open c:\windows\rdweb\site.xsl in your favorite editor and find line 665 (highlighted in the screenshot):
27 RDS Web Access Smart Sizing 01
(or find that code if you made any modification to site.xsl before)

Insert the following code on that line:

strRdpFileContents += "smart sizing:i:1\\r\\n";

The result must look like this:
27 RDS Web Access Smart Sizing 02
Now save the file, and reload the Web Access page, or open the page, as long as the site.xsl gets re-rendered.

Now when we connect to that same VDI it will still open in full screen mode, but when we resize the Remote Connection Window we can see that with adding just that one line of code we now have smart sizing enabled:

27 RDS Web Access Smart Sizing 04

Like I said, just a quick little post.

Arjan

20+ years experience in Microsoft powered environments. Enjoy automating stuff using scripts, powershell, and even batch files. In my free time (hah! as if there is any) I hunt achievements and gamerscore on anything Xbox Live enabled (Windows Mobile, Windows 8, Windows 10, Xbox 360 and Xbox One). When I'm not doing that I enjoy traveling or riding my Yamaha R1 on the edge ;)

Tagged with: , ,
Posted in Customize, Remote Desktop, Windows 2012 R2
11 comments on “Enable smart sizing in RDP through Remote Desktop Services 2012R2 Web Access
  1. Ramsy lowes says:

    Very Nice Arjan, thanks.

  2. Eric says:

    Nice find!!
    Thanks for the share

  3. Emil says:

    Hi Arjan,

    I have a question. It is possible to change default screen size(not screen resolution), because if I switch from full screen to window (with smart sizing enabled) my windows is very small and if I resize after logoff window size is smaller again. Thanks in advance.

    • Arjan Mensch says:

      Hi Emil,

      Yes I believe it is.

      Instead of adding the line

      strRdpFileContents += “smart sizing:i:1\\r\\n”;

      Add these lines:
      strRdpFileContents += “screen mode id:i:1\\r\\n”;
      strRdpFileContents += “desktopwidth:i:1280\\r\\n”;
      strRdpFileContents += “desktopheight:i:1024\\r\\n”;

      This will tell the RDP file (which is launched by the ActiveX in WebAccess) to use a non fullscreen session using 1280×1024 (adjust if needed).

      Untested, but taken from a locally saved .rdp file with these settings.

  4. Emil says:

    Sorry,

    Is it possible to change default window size(not screen resolution), because if I switch from full screen to window (with smart sizing enabled) my windows is very small and if I resize after logoff window size is smaller again. Thanks in advance

  5. AlektroNik says:

    Hi Arjan, thank you for an excellent article.
    I want to set up automatic replication of all customizations made on the same server Remote Desktop Services 2012R2 Web Access server for all other Remote Desktop Services 2012R2 Web Access.
    Please tell me which folder you want to add a DFS replication?

    • Arjan Mensch says:

      Hi AlektroNik,
      Since modifications usually happen only once in a while, I would not setup DFS but instead would do modifications on a Development server if possible, and simply copy the folder structure to the other web access server(s).

  6. odarchuk says:

    Don’t working for Windows 2016. After editing site.xsl i have error: Error loading stylesheet: Parsing an XSLT stylesheet failed.
    Help me

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog Authors
Donate Button

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 322 other followers

Blog Stats
  • 1,913,769 hits
%d bloggers like this: