Add multi monitor option to remote desktop web access
I have a test environment for a remote desktop farm with a connection broker load balancing logins across remote desktop session host servers. All servers are built on Server 2012 R2. Using rd web access, we can access this farm from anywhere.
When logging in via web access, you can choose the screen resolution or use full screen. If you have two monitors when selecting full screen, it will always use both your monitors.
Does anyone know how to adjust the RDWeb page so that you can choose whether or not to use both your monitors?
This option is in the GUI from RDP 6.1 onwards, so I would imagine there is a way to also add it the web access page.
Solution 1:
Default there is no option for the user to choose between the use of one or multiple monitors in a Microsoft RDS Farm based on Windows Server 2012(R2). Although there is an option to add/replace options in the RDP File content that is generated by the RD Web Access page. This can be done by modifying the ShowOptimizeExperience checkbox.
To accomplish this you need to execute the following steps:
-
Change the application settings in IIS Manager
-
Modify the Site.xsl file
-
Modify the RDWAStrings.xml file
Change the application settings in IIS Manager
-
Start IIS Manager
-
Go to: Default Web Site -> RDWeb -> Pages -> Application Settings
-
Change the option ShowOptimizeExperience from False to True
Modify the RDWAStrings.xml file
Go to the following path: C:\Windows\Web\RDWeb\Pages\en-US
Open the file RDWAStrings.xml in notepad
Replace the text:
<string id="OptimizeMyExperience">Optimize my experience for a LAN network when connecting to the computer or application.</string>
with the following text:
<string id="OptimizeMyExperience">Use multiple monitors.</string>
Modify the Site.xsl file
Go to the following path: C:\Windows\Web\RDWeb\Pages
Open the file Site.xsl
Search for the text strRdpFileContents
Replace the text:
<xsl:if test="$showoptimizeexperience">
if (<xsl:value-of select="$feedidprefix"/>Controls.chkShowOptimizeExperience.checked) {
var objRegExp = new RegExp("connection type:i:([0-9]+)", "i");
var iIndex = strRdpFileContents.search( objRegExp );
<!-- Add 'connection type' if it does exist otherwise replace. -->
if ( -1 == iIndex ) {
if ( "\\n" != strRdpFileContents.charAt(strRdpFileContents.length-1) ) {
strRdpFileContents += "\\r\\n";
}
strRdpFileContents += "connection type:i:6\\r\\n";
} else {
strRdpFileContents = strRdpFileContents.replace(objRegExp, "connection type:i:6");
}
}
</xsl:if>
With the following text:
<xsl:if test="$showoptimizeexperience">
var pmxUseMultimon = 0;
if (<xsl:value-of select="$feedidprefix"/>Controls.chkShowOptimizeExperience.checked) {
pmxUseMultimon = 1;
}
var objRegExp = new RegExp("use%20multimon%3Ai%3A([0-9])", "i");
var iIndex = strRdpFileContents.search( objRegExp );
<!-- Add 'use multimon' if it does exist otherwise replace. -->
if ( -1 == iIndex ) {
if ( "\\n" != strRdpFileContents.charAt(strRdpFileContents.length-1) ) {
strRdpFileContents += "\\r\\n";
}
strRdpFileContents += "use%20multimon%3Ai%3A"+pmxUseMultimon+"\\r\\n";
} else {
strRdpFileContents = strRdpFileContents.replace(objRegExp, "use%20multimon%3Ai%3A"+pmxUseMultimon);
}
</xsl:if>
Note:
As you can see in the original text, Microsoft is searching for the regular expression "connection type:i:".
In the rdp file content that is generated the text is "connection type%3Ai%3A".
This means that the option "Optimize my experience" of Microsoft is never going to work.
When you now go to your RDS Web page you will see a check box with the text "Use multiple monitors"
It's very important to set the Remote App configuration "Maximum number of redirected monitors" to a number higher than 1. Unless this solution doesn't work.