Thursday, July 30, 2015

Branding Microsoft Remote Desktop Web Access 2012 R2

I have been working on few Microsoft Remote Desktop Services implementation on Windows Server 2012 R2. Recently I was asked to customise the remote desktop web access site. I found few great blog post about customising website but there wasn't too many posts about branding RDS on Windows 2012 R2. Against all good IT principals, I decided to make proper documentation of the installation. Because there wasn't too much information available, I decided to write a public post about it.

Link to blog that I have been using as reference:

Backup RD Web Access Site

Before making any changes, I recommend to take a backup of the RD Web Access files. Easiest way to do this is just take a copy of C:\Windows\Web\RDWeb folder to some safe place.

IIS Redirection

By default when you write server name to address you land to IIS default site. The RD Web Access is on http://rdwebserver.domain.local/rdweb url. I want users to land on the RD web access page directly.  Easiest way to do this from IIS Manager. 

Open IIS Manager and navigate to Default Web Site and open Folder Redirection. 
Select Redirect requests to this destination and write /RDWeb to the destination. Save settings and restart IIS.

Removing the domain prefix requirement

I followed instructions form this Arjan Mensch's blog post.

Cleaning up the RD Web Access login page

I wanted to clean login page from all Microsoft look and feel.

Remove Help button from login page

This part is copied from Arjan Mensch's blog post:

Arjan has gone through many other customisations that I didn't need, so I found it easier to just copy and paste the parts I did in this project.

To hide the Help link on the login page you need to edit %windir%\web\rdweb\pages\site.xsl.

Go to line 152.

Change this line to look like this: <!--<a id='PORTAL_HELP' href="javascript:onClickHelp()">

And change line 154 to look like this: </a>-->

Making these two changes turns the code to display the link into a comment and thus hidden. Save the file.

Note: this removes the link from the login and password pages only. After logging in you’ll see the link is still there on the main page. 

Force Security settings  to Public


This part is copied from Arjan Mensch's blog post:

We need to fix two thing to be able to force users to the public setting without means to change it.

Edit “login.aspx”.

Change lines 523, 532, 536, 556, 576 and 587 from <tr>

to <tr style="display:none">

These changes will effectively hide the user interface for changing the security setting. Save the file.

Edit “webscripts-domain.js” and go to line 14:
var bPrivateMode = document.getElementById("rdoPrvt").checked;

Change this line to: var bPrivateMode = false;//document.getElementById("rdoPrvt").checked;

This change will force the code to always configure for public mode. Save the file.

Refresh or open the Web Access page and you’ll see the interface options for choosing a security mode is gone.

Remove gray dividers and disclaimer

This part is copied from Arjan Mensch's blog post:

To hide the grey dividers as well you’ll need to edit “login.aspx” again.

Change lines 513, 516, 519, 597, 609 and 612 from <tr> 

to <tr style="display:none">

To remove or edit disclaimer you need to edit  “login.aspx” and move to line number 41 and change it to look like this:

const string L_TSWATimeoutLabel_Text = "" ;

You can also insert your custom disclaimer there. 

After these changes RD web access login page should like like this:

Changing RD Workspace name and title

By default RD Workspace name is Work Resources. This can be changed from RD Connection broker with powershell.

Login to RD Connection broker with account that has domain admin rights and open Powershell.
Type following commands:

import-module remotedesktop
Set-RDWorkspace -Name "Your own RD Farm"

To change site title and text below the RD Workspace name you need to edit %windir%\web\rdweb\pages\en-US\RDWAStrings.xml 

This file contains labels and texts that are used everywhere in RD Web Access site, not just on the login page.  Just few examples:

Line 3 contains page title:
<string id="PageTitle">RD Web Access</string> 

Line 10 contains the text on top right corner:
<string id="HeadingRDWA">RD Web Access</string>

Line 11 contains the text under RD Workspace name:
<string id="HeadingApplicationName">RemoteApp and Desktop Connection</string>

Branding the RD Web Access login page

Login page texts

Other texts and messages on RD Web Access login page can be changed by editing %windir%\web\rdweb\pages\en-US\login.aspx 
You can find text under Localizable Text comment, on lines 19 - 49.

Login page images and colors

To change site logos and colors you need to edit %windir%\web\rdweb\pages\site.xls

This file is quite well commented, so you can find quite easily where everything is, so I am not going to too much details on this.

The logo on top right corner is on line 91:
<img src="../images/logo_01.png" width="16" height="16"/>

You can either change own logo here, or just comment the line out like this:
<!-- <img src="../images/logo_01.png" width="16" height="16"/> -->

The logo on top left corner just besides the workspace name can be found below text Replaceable Company Logo Image on line 117:
<img src="../images/logo_02.png" width="48" height="48"/>

You can just save your own logo file to images folder and change it here.

The logo on bottom left corner is on line 207:
<img src="../images/WS_h_c.png" width="143" height="20"/>

The logo on bottom right corner is on line 217:
 <img src="../images/mslogo_black.png" width="63" height="10"/>

You can either change these logos to your own, or just comment the line out.

Branding Remote Desktop page

Most of changes described earlier on this post are global, so they affect also the Remote Desktop page.

Remove "Connect to a remote PC" Option

This can be done easily from IIS Manager. 
Open IIS Manager and navigate to Site, Default Web Site, RDWeb and Pages. 

Open Application Settings and change Show Desktops to false.


Removing Current Folder Text

This part is copied from Arjan Mensch's blog post:


Edit %windir%\web\rdweb\pages\site.xsl.

This is just below <!-- deal with folder icons and labels --> comment, on line 529 (if you haven't edited this file before)

<div class="tswa_CurrentFolderLabel"><xsl:value-of select="$strings[@id = 'CurrentFolder']"/><span><xsl:attribute name='id'><xsl:value-of select="$feedidprefix"/>CurrentFolderPath</xsl:attribute><xsl:value-of select="appfeed:Publisher[1]/@DisplayFolder"/></span></div>

Anyway, you’ll need to edit the line to look like this:

<div class="tswa_CurrentFolderLabel"><span><xsl:attribute name='id'><xsl:value-of select="$feedidprefix"/>CurrentFolderPath</xsl:attribute><xsl:value-of select="substring-after(appfeed:Publisher[1]/@DisplayFolder, '/')"/> </span></div>

If you just want to change the text to something else, this can be done by editing %windir%\web\rdweb\pages\en-US\RDWAStrings.xml 

Removing RemoteApp and Desktops text

Edit %windir%\web\rdweb\pages\en-US\default.aspx.

This information is found on Line 18:
const string L_RemoteAppProgramsLabel_Text = "RemoteApp and Desktops";

You can simply just delete the text, or insert your custom text here.


Conclusion

Windows Server 2012 R2 Remote Desktop Services Web Access can be customised with out 3rd party software or consultation. I will probably update this post later when I find other things I need to change. I hope this is helpful!

7 comments:

  1. Do you have an updated guide for RDS 2016?

    ReplyDelete
  2. Great Post Arjan.
    I have a requirement. request you to please help me.

    I need to remove the word RemoteApp from the message box that appears when we click on a published program. Is there a way to hide that box entirely or show something else while my users are waiting for the program to open.

    Thanks in advance

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Thanks for the effort, very useful

    ReplyDelete
  5. Is it possible to put a watermark in the whitespace behind the applications?

    ReplyDelete
  6. Great, your articles are really very informative and easy to understand. Thanks for this special article. Do you know about the Turkish visa for US citizens ? Yes, and I will give you 1 suggestion . Don't waste your time behind the old physical visa system. A new electronic visa system is developed and it is very successful .It makes your journey easier and better.

    ReplyDelete