Quantcast
Channel: JJClements.co.uk » RDP
Viewing all articles
Browse latest Browse all 2

RDP Hyperlink

$
0
0

I recently started using Zenoss (an open source application, server and network management platform) to monitor servers. One of the options that can be configured for each of the devices being managed is a hyperlink that can open a website or application of some relevance. In a situation where I am informed of an issue with a server/application I instinctively try to open a Windows remote desktop session to the server. This used to involve manually opening the Microsoft Terminal Services Console (mstsc.exe), keying the server name and then clicking the connect button. I wanted a way to click a hyperlink from the Zenoss web console and establish an rdp session to the relevant server.

Since some protocols are identified by a prefix (ftp:// http:// https://) I decided to use rdp:// as the prefix to launch mstsc.exe. I have combined the necessary registry keys and the required JScript file into a single .bat file that allows for easy installation/uninstallation of the rdp hyperlink association. When you run rdp.bat you are presented with 3 options:

rdpoptions.png

Option 1. Adds registry key HKCR\rdp which contains the parameters needed to associate the rdp:// prefix with a file created in C:\Windows called hyperlink-rdp.js. The JScript file is responsible for some string manipulation that trims the rdp:// prefix and then passes the remaining string (server name) to mstsc.exe to try and establish the rdp session.

Option 2. Removes registry key HKCR\rdp and the C:\Windows\hyperlink-rdp.js file.

Option 3. Exits the batch file.

After you use rdp.bat to create the hyperlink association you can launch an rdp session by clicking any hyperlink in the form of:

rdp://someserver

Typing rdp://someserver into your browser or windows explorer address bar will also launch the Microsoft Terminal Services Console and attempt to establish a session.

Note: When clicking an rdp:// hyperlink for the first time from a browser it is likely that you will receive a prompt that the browser is trying to launch a local application. You will need to allow this in order for the Microsoft Terminal Services Console to be opened and a session established.

After creating the rdp association on my Windows computer I added a specific link to the device in my Zenoss web console by:

1) Navigating to the device
2) Clicking the options drop down arrow
3) Selecting More --> zProperties
4) Adding a HTML hyperlink to the zLinks property

The syntax for a standard HTML hyperlink is:

<a href="rdp://someserver">rdp://someserver</a>

Although the above hyperlink works, I later discovered that Zenoss makes use of TALES expressions, one of which can be substituted for the server name (someserver) in this instance. If you use TALES you would only need to set the hyperlink once globally for all Windows servers by:

1) Navigating to Devices --> Server --> Windows
2) Clicking the zProperties tab
3) Adding the Zenoss TALES hyperlink to the zLinks property

The syntax for the Zenoss TALES hyperlink is:

<a href="rdp://${here/id}">rdp://${here/id}</a>

You will then have a clickable hyperlink on the Status tab from within the Windows device (or any new devices you add if you use the Zenoss friendly hyperlink):

zenosslinks.png

Note: If you are planning to run rdp.bat on Windows Vista or Windows 7 you will need to run it with Administrator privileges. You can do this by right clicking rdp.bat and choosing 'Run as administrator':

rdpasadmin.png

Download rdp.bat - HERE

Note: Since this article I have also written another post on creating SSH and SCP Hyperlinks


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images