I have a lot of servers that I connect to using remote desktop. Windows only remembers
the last 10 servers to which you connected. There are some 3rd party applications
that manage your connections, but I wanted to use Sharepoint and not install another
local application.
I wanted to use a Sharepoint list to store and manage my Remote Desktop Connections.
I also wanted to be able to click on a hyperlink to open the connection.
There are several obstacles to this goal:
- There is no protocol for opening Remote Desktop Connections via a URL.
- Even if there was Sharepoint won’t let you use it. It will only allow http:// or
https:// in a hyperlink column.
- The hyperlink column doesn’t give you the option of launching the link in a new
window.
If I were using an on premise Sharepoint implementation I might consider creating
a custom column, but I want this to work in Office365.
Creating a rdp:// URL Protocol
This will need a Registry tweak to add a new url protocol to mstsc.exe. Here is
a reg file which will update the Registry with the new rdp:// protocol.
Windows
Registry Editor Version 5.00
HKEY_CLASSES_ROOT\rdp]@="URL:Remote Desktop Connection" "URL Protocol"=""
HKEY_CLASSES_ROOT\rdp\DefaultIcon]@="C:\\WINDOWS\\System32\\mstsc.exe"
HKEY_CLASSES_ROOT\rdp\shell]
HKEY_CLASSES_ROOT\rdp\shell\open]
HKEY_CLASSES_ROOT\rdp\shell\open\command]@="cmd /V:ON /s /c set url=%1 && set url=!url:rdp:=! && set url=!url:/=! && start C:\\WINDOWS\\system32\\mstsc.exe /v:!url!"
Once you’ve updated your registry you will be able to create url links like this
one which, when opened will launch a new Remote Desktop Connection to the server:
rdp://server
Save the above into a file called Remote Desktop Protocol.reg. The idea is
to make this reg file available through the Sharepoint site for first time users
who don’t have it. There is a problem in that because you won’t be able to upload
a reg file to the Site Assets library, so I suggest adding it to a Remote Desktop
Protocol.zip file first.
Create a redirect page
Sharepoint won’t let us use our new rdp:// protocol in a hyperlink column, so to
get around this limitation we need to create a redirect page we can use in a hyperlink
column and pass it the link we really want to open in the query string.
Open up your site in Sharepoint Designer. Select All Files under Site Objects, click
the File button on the Ribbon and choose to create a new ASPX file.
Name the file redirect.aspx and copy in the markup below:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="WebPartPageExpansion" content="full" />
<title>Remote Desktop</title>
</head>
<body>
<script type="text/javascript">
window.open(window.location.search.substring(1));
window.history.back()
</script>
</body>
</html>
Create the Custom List
Open up your site and create a new Custom List and add a new hyperlink column to it.
Create a new list item and enter the following in the Hyperlink Url:
https://companyweb.sharepoint.com/site/redirect.aspx?rdp://server
If you have applied the registry tweak, when you open the link you should see a new Remote Desktop Connection open up.
Finally, I edited the default page and added some text along with a link to the Remote Desktop Protocol.zip file which I added to the Site Assets library.
I also added a List Web Part to display a customised view of just the hyperlink
column from my Custom List. Here’s what it looks like: