How to integrate Remote Desktop Services and SharePoint


I just finished setting up an RDS farm and, as part of the setup, I needed to setup the RDWeb (Remote Desktop Services Web Access) and integrate it with our SharePoint 2007 intranet portal. I was surprised to find out that the process of integrating RDS with SharePoint was rather tedious and not very well documented. I found a few articles, including one on TechNet that explained the process, however they were either incomplete or geared toward setting up SharePoint and RDWeb on the same server.

My situation (and from the many forum posts I read, it seems this was the case for many others) was different – I needed to setup a separate installation of RDS (and make it redundant see post here) and then integrate it with SharePoint. After piecing together a few different articles, blog posts and forum posts and a healthy amount of educated (and some not so educated… 🙂 ) guesses I finally got it to work. Here is how…

First – the environment. This was setup on a total of 8 servers:

  • 2 front end IIS servers running the Remote Desktop Web Access role only (setup with Windows NLB for load sharing and redundancy)
  • 2 middle tier boxes running Remote Desktop Licensing and Remote Desktop Connection Broker (setup as a Windows Cluster, for redundancy). One important thing to note is that the RemoteApp and Desktop Connection Management service was also clustered as it is an integral part of the application list population function for the front end IIS boxes and the SharePoint web part
  • 2 Session Host servers (load balanced with Windows NLB and setup in an RDS Farm)
  • 1 SharePoint front end server
  • 1 SharePoint DB server (not really related to the setup directly, but a part of the environment nevertheless)

All servers are Windows 2008 R2 Standard 64-bit, except the two middle tier clustered boxes, which were Windows 2008 R2 Enterprise 64-bit, because of the clustering. This is very important as it makes a BIG difference in some of the steps, especially in GAC registration (because of Windows 2008 R2) and certain paths I list (because of the 64-bit edition). If you have different setup, change details accordingly.

Here is the meat. This assumes you have a functional RDS environment, i.e. you can open applications via the standard RDWeb web site and that the RDWeb web site is setup with Windows Authentication, not Forms… If you have not done that, here is how:

Edit the C:\Windows\Web\RDWeb\Pages\web.config file:
– un-comment <authentication mode=”Windows”/> section
– comment out the <authentication mode=”Forms”> section.
– comment out the <modules> and <security> sections in the <system.webServer> section at the end of the file.

Now to the web part setup…

1. Edit the web.config of the SharePoint site you will be adding the RDS web part to, adding the following, in one line, to the SafeControls section. This can be the root site, or a sub site. Find the path to the file system from IIS manager:

<SafeControl Assembly=”TSPortalWebPart, Version=6.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ Namespace=”Microsoft.TerminalServices.Publishing.Portal” TypeName=”*” Safe=”True” AllowRemoteDesigner=”True” />

2. Create images directory structure and secure it properly:

mkdir “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\wpresources\TSPortalWebPart\6.1.0.0__31bf3856ad364e35\images”

mkdir “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\wpresources\TSPortalWebPart\6.1.0.0__31bf3856ad364e35\rdp”

cacls “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\wpresources\TSPortalWebPart\6.1.0.0__31bf3856ad364e35\images” /T /E /P NetworkService:F

cacls “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\wpresources\TSPortalWebPart\6.1.0.0__31bf3856ad364e35\rdp” /T /E /P NetworkService:F

3. Copy TSPortalWebPart and TSPortalWebPart.Resources DLLs from a server running the “Remote Desktop Web Access” role:

xcopy C:\Windows\assembly\GAC_64\TSPortalWebPart c:\temp\TSPortalWebPart /d /e /c /i /y

xcopy C:\Windows\assembly\GAC_64\TSPortalWebPart.Resources c:\temp\TSPortalWebPart.Resources /d /e /c /i /y

4. Copy the two directories to your SharePoint server’s c:\temp

5. Login to the SharePoint server console as administrator

6. Open Task Manager, go to Processes tab and click Show Processes from all users

7. Kill ALL Explorer.exe instances for your session

8. Go to File, New Task (Run…) and open an Explorer.exe instance (this makes it run as admin and no, it does not work if you just right-click on Explorer and choose Run as administrator)

9. Drag and drop the c:\temp\TSPortalWebPart\6.1.0.0_en_31bf3856ad364e35\tsportalwebpart.dll and c:\temp\TSPortalWebPart\6.1.0.0_en_31bf3856ad364e35\TSPortalWebPart.resources.dll into the GAC (C:\Windows\assembly)

10. Verify the TSPortalWebPart and TSPortalWebPart.Resources directories are created under c:\Windows\assembly\GAC_MSIL\ (do a dir c:\Windows\assembly\GAC_MSIL\)

11. Copy the remaining files into the GAC directory created by dropping the two DLLs in

xcopy c:\temp\TSPortalWebPart\6.1.0.0_en_31bf3856ad364e35 c:\Windows\assembly\GAC_MSIL\TSPortalWebPart\6.1.0.0__31bf3856ad364e35 /d /e /c /i /y

xcopy c:\temp\TSPortalWebPart.Resources\6.1.0.0_en_31bf3856ad364e35

c:\Windows\assembly\GAC_MSIL\TSPortalWebPart.Resources\

6.1.0.0__31bf3856ad364e35 /d /e /c /i /y

(the above three lines are actually one command, just concatenate them before executing. For some reason the blog editor is chopping off the end if they are all together…)

12. Recycle the site’s app pool

13. Populate the web part gallery

#In the upper-right corner, on the Site Actions tab, click Site Settings.
#Under Galleries, click Web Parts.
#Under the Web Part Gallery heading, click New.
#Select the check box next to Microsoft.TerminalServices.Publishing.Portal.TSPortalWebPart, and then click Populate Gallery.

14. Create images directory under the website root and copy all images from \TSPortalWebPart\ to it (PNG, GIF, JPEG)

15. Add the user account of the SharePoint web site App Pool into the TS Web Access Computers group on the server where RemoteApp and Desktop Connection Management service is running (it should already have the names of the front end Remote Web IIS servers). In my case it is the clustered middle tier.

16. Add the web part to the SharePoint site

17. In the web part choose RemoteApp and desktop Connection Management for Populate the Web Part from option and enter the name of the server/cluster where the service resides

Your web part should now have icons from the RDS Session Hosts.

Enjoy! 🙂

Advertisements

6 Responses to “How to integrate Remote Desktop Services and SharePoint”

  1. I have SBS2011 installed and added a tetrminal server. I have the Remote Apps on the tetrminal server available via RWApp Site on SBS2011.

    Now I want to add the TSPortalWebPart to The CompanyWeb (Which is available on Port 987 externally..

    When I access the site after doing what you suggested.. I still do not get the WQebPart to show up?

    I would be willing to employ someone as a consultant to get this to work and show me how you did it.

    • Without having any specific error messages to work with my first suggestion would be to go over the steps in my post carefully and verify everything is done and in place. Ensure there are no typos in config file changes and you are not missing any specific files after you copy the DLLs in the respective directories. This is a VERY finicky process and the slightest deviation from the steps or anything done out of order will result in failure.

      That said, also check the event log and text log files on the SharePoint server and see if there are any errors. Post back your results, I will try to help.

      Nayden

    • Joe,
      Did you get it to work?

      Nayden

  2. Bruno Bertechini Says:

    Hi there, the process did work for the “root” site (top-level) . But the webpart is not showing up in subsites. (An error message is shown saying the images are not found — but the path is appended with the subsite directories, which do not exist in fact).

    Is there a workaround for this issue?

    Bruno

    • Hi Bruno
      I don’t have access to that application any longer (I work at a different company and don’t deal with SharePoint) but I would try creating the directories on the SP server manually, where the app seems to expect them to be (might have to create a virtual directory in IIS or just drop them under the 12 hive in Program Files). Sorry I can’t be of more help, but I can’t test this anywhere at the moment.

      • Kyle Says:

        Hi Guys I have the same problem as Bruno, did anyone figure out a fix for this? I tried creating the folders that it was looking for the images in but then I get an error saying that it cant locate the default.aspx file. I assume once you create the file path it wants for the images it somehow wants ALL of the sites files to be in there…

        Very weird and driving me NUTS.

        Please help 😦

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

%d bloggers like this: