Monday, December 7, 2015

Publish Remote Desktop Session (Full Desktop) in a Remote App Session Collection

Remote Desktop Services 2012+ allows you to publish two types of the Session collection on a Remote Desktop Session Host. This can be either a Remote Desktop Session Collection (Full Desktop experience) or a Remote App Session Collection. By default you cannot have both types on the Same Session Host. And this is frustrating.
Remote App Session Collection looks like this:

From the image above you see that only Remote Apps are shown and no "Full Desktop" RDP icon.
In fact, the moment you publish your first RemoteApp, the desktop connection disappears and the checkbox "Show the session collection in RD Web Access" is grayed out.


You may find some technical blogs which provides the guide how to bypass this limitation (for Session collections only). Per those blogs you may consider changing the following registry value on your RDCB hosts:

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\CentralPublishedResources\PublishedFarms\<collection>\RemoteDesktops\<collection>


To show the Desktop Session Icon, Change the Dword value (ShowInPortal) to 1 from 0.
You can also rename the Desktop Session Icon name to something more to your liking. To do this, change the String value (Name).
There are issues after such modifications

Issue #1
After some testing you may find issues with User Profile Disks (UPD) and multiple RDS Hosts. When a user logs in to a RemoteApp, it will map the user to the user profile disk (UPD) as expected.
If the user starts a new connection (Full Desktop) while having a RemoteApp open, the user will get a temporary profile and a blank screen as the UPD cannot load. This means that when you launch a RemoteApp, the UPD is locked to that session meaning you cannot load a full blown desktop at the same time.

Issue #2
The "Full Desktop" stops also working and clear “Full Desktop” registry settings after any minor change to already created “Remote App Session Collection. So you need to update the registry key after any change to the Session Collection.

Solution

Here is more elegant and reliable solution that works without any issues (single Active Directory domain for RDSH and RDS users).
  • Publish "Remote Desktop Connection" (RDP client mstsc.exe) program
  • Go to the published program (mstsc.exe) settings
  • Type the RemoteApp program name, ex. "Full Desktop"

  • Go to the "Parameters" tab of "mstsc.exe" published program. Here is where the magic begins

  • Update "Command-line Parameters" with parameter "/V:%computername%.%UserDnsDomain%"
  • Save properties by clicking "OK" and check result

This modification makes RDP session to run on the same Session Host (provided command-line parameter is FQDN of current RDS host) where mstsc.exe had been run initially. No registry modification is needed. No issues at all.
The solution is really interesting for hosters and MSPs who provide Microsoft RDS DaaS (Desktop as a Service) to their customers; where you can combine both: "Full Desktop" experience and RemoteApp Session Collections experience with no need to create separate RDS farms.