Showing posts with label Sharepoint Online. Show all posts
Showing posts with label Sharepoint Online. Show all posts

“Remote Desktop Links” Custom List in Office365

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:

  1. There is no protocol for opening Remote Desktop Connections via a URL.
  2. Even if there was Sharepoint won’t let you use it. It will only allow http:// or https:// in a hyperlink column.
  3. 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:

Sharepoint 2010 "Hyperlink with Picture" Column Type

I've recently published my latest CodePlex project. It's a Sharepoint 2010 Custom Field Type that extends the SPUrlField type to allow you to have an image instead of a text description as the link.

When creating a new column, the feature adds a new type called "Hyperlink with Picture"



The new column is exactly the same as a Hyperlink type column, but instead of displaying the link as the description text, it shows an image instead.



When editing a list item you enter the target url and the url to the image you want to display for the link



When you view the list item the image will display and open the target url link when clicked

Sharepoint 2010: Resource Booking WebPart

I had a request to build a simple generic, configurable, weekly resource booking web part for Sharepoint 2010.  Here is a list of the design goals that we set:
  • Ability to have multiple resource booking webparts on a single Sharepoint Web
  • The available resources should be configurable by the end users
  • A weekly view of bookings
  • Ability to easily identify resources that can be booked and to filter the weekly view
  • Validation to guard against double bookings
  • Ability to delete bookings you created
  • Defaults to make creating new bookings quick and easy
  • Use AJAX to avoid ugly post backs (page reloads)
The resulting Sharepoint Feature contains a WebPart which is deployed at Site level and can be used in any site within the Site Collection.  A Web level Feature contains List Templates for the Resource list and the Bookings list which can be activated by any site administrator that wants to use the Resource Bookings WebPart.

The Resource Booking WebPart has two custom properties to link it to the Resource list and the Bookings list.  The Resource list is included on the Quick Launch menu, while the Bookings list in not.  It's possible to change this, of course, along with list permissions and adding your own views to the Bookings list to extend functionality for the users.

Below is a screenshot of the Resource Booking WebPart.


The Resource Booking WebPart defaults to show the current week starting on a Monday.  At the top it shows the week start date and end date, there are arrow buttons to navigate to the previous and next weeks.

Each box shows the Bookings for a particular day sorted in time order.  Bookings with a red cross next to them are one's made by the currently logged on user, clicking the red cross will delete the booking.  You can only delete your own bookings using the WebPart, you could open the Bookings list and delete bookings from there if you have sufficient permissions.  Hovering the mouse over a booking will popup who own's that booking, as shown in the screenshot.

In the bottom right hand corner is a list of all the resources that are available for booking.  This list is created from the Resources list which is managed by the users.  Checking the boxes against the resources will filter the view to show only those bookings against the selected resources.  You can filter the view and still navigate to previous or next weeks keeping the chosen filter in effect.

To create a new booking simply click on the icon.  Below is a screenshot of the New Resource Booking view:


The From time defaults to the current time and the To time to the current time plus one hour.  The Owner will default to the currently logged on user.  All of the fields are required and there is validation in place to ensure there is no double booking of resources.  The validation error message will tell you who has the resource booked when the times they have it reserved.