Allowing Remote Assistance to accept the machine name as a parameter

In a previous post I talked about how the Program Builder functionality of Service Desk Express allowed me to launch the Microsoft Remote Assistance tool. Whilst this was neat, what I really needed was to be able to prefill the machine name on the remote assistance page with a machine name as shown below:

Remote Assistance Screen

Remote Assistance Screen

The first thing we needed to do was to hack the Remote Assistance tool to accept a parameter. To do this you need to open

C:WINDOWSpchealthhelpctrVendorsCN=Microsoft Corporation,L=Redmond,S=Washington,C=USRemote AssistanceEscalationUnsolicitedUnSolicitedRCUI.htm

using, for example Notepad. Near the top of the file there is a function called OnLoad that looks like:

function onLoad()
{
;
;
try
{
setTimeout("idComputerName.focus()",250);
g_oSAFRemoteDesktopConnection = oSAFClassFactory.CreateObject_RemoteDesktopConnection();
}
catch(error)
{
FatalError( L_RCCTL_Text, error );
}
;
return;
}

All we need to do is add a couple of lines of Javascript at the top of this function that basically says, if the QueryString of the passed URL (the bit after the ? in a URL e.g. p=51 in the case of http://www.joatit.com/wordpress/?p=51 ) is not equal to the word “machinename”, prefill the machine name in the idComputerName textbox. So after editing, the function should look like:

function onLoad()
{
;
;
try
{
if (window.location.search.substring(1)!= "machinename")
{
idComputerName.value = window.location.search.substring(1);
}
setTimeout("idComputerName.focus()",250);
g_oSAFRemoteDesktopConnection = oSAFClassFactory.CreateObject_RemoteDesktopConnection();
}
catch(error)
{
FatalError( L_RCCTL_Text, error );
}
;
return;
}

Ok, so save that and now we are ready to launch it from Service Desk Express. So as per the previous post, log onto the Service Desk Express application server and run builder.exe that lives in C:Program FilesBMCService Desk ExpressTools. You should be greeted with a screen that looks like the example below:

Program Launcher

Program Launcher

In the Filename textbox enter: RemoteAssistance.asp

In the Command line textbox enter:

C:WINDOWSPCHEALTHHELPCTRBinariesHelpCtr.exe -url hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/ Remote%20Assistance/Escalation/Unsolicited/ UnsolicitedRCui.htm?machinename"

and click Build Launch File.

Now using Form Customisation you can add a Customised Toolbar Button of type link to, for example, the Machine Name field in the Inventory Item module, by specifying a URL of:

http://<SDEServerName>/SDE/RemoteAssistance.asp?machinename=$64$

So, the obvious question is, where does the $64$ come from? The answer lies by running the following SQL statement:

SELECT * FROM SMSYSDBINFO WHERE View_Name = 'Inventory Items'

If you find the Machine Name field in the ALIAS column and look across to the INTERNAL_COL_ID for that field, you will find 64.

The final “icing on the cake” comes by using the DB Admin Tool to expose that Machine Name field to the Incident module by adding a new virtual field (let’s say called ‘Asset Machine Name’) through the existing Seq.Inv.Item foreign key. Run the following SQL statement…

SELECT INTERNAL_COL_ID FROM SMSYSDBINFO WHERE View_Name = 'Incident' AND ALIAS = 'Asset Machine Name'

and then using Form Customisation you can add a Customised Toolbar Button of type link on the Incident form to that newly exposed field. Now you can launch the Remote Assistance tool from the incident form, populating the machine name direct from the selected asset!

Hope it helps – as always all comments very welcome!

Microsoft Remote Assistance and Service Desk Express

Out of the box Service Desk Express supports a number of remote control solutions that allow support analysts to take control of the user’s desktop and support them. Recently, I was asked if Service Desk Express would support Microsoft’s Remote Assistance tool. After a day of messing about, I finally managed to deliver a rather elegant (well at least I and the customer thought so) solution that I thought I would share:

For those of you who have never seen Microsoft Remote Assistance, it is, believe it or not, included out of the box with Windows XP. The problem is that it is incredibly hard to find! To use it from your desktop, create a shortcut pointing to:

%WINDIR%Explorer.exe "hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/ Remote%20Assistance/Escalation/Unsolicited/UnsolicitedRCui.htm"

Rolls off the tongue doesn’t it?!?

Now once you actually find it, it works rather nicely providing complete auditing, handshake etc. So now I needed to get this launched from inside Service Desk Express. This was where the fun started.

I knew that the solution lay with the Program Launcher application that comes with Service Desk Express beyond patch 9.12 (many thanks to David Sullivan for posting the URL to the documentation for that in the MagicSolutions forum (http://www.bmc.com/supportu/documents/90/41/69041/69041.pdf)). However, it wasn’t quite as simple as I had hoped.

For some reason I couldn’t get the link to work with the Program Launcher application due to all the quote marks, forward and backward slashes etc. That was probably my lack of knowledge…

However, after much ado I discovered (thanks to Google) that you can launch the Windows Help Center itself passing a URL for the hcp file mentioned above. So to get this to work:

Log onto the Service Desk Express application server and run builder.exe that lives in C:Program FilesBMCService Desk ExpressTools. You should be greeted with a screen that looks like the example below:

Program Launcher

In the Filename textbox enter: RemoteAssistance.asp

In the Command line textbox enter:

C:WINDOWSPCHEALTHHELPCTRBinariesHelpCtr.exe -url hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/ Remote%20Assistance/Escalation/Unsolicited/UnsolicitedRCui.htm

and click Build Launch File.

Now using Form Customisation you can add a Customised Toolbar Button of type link to, for example, your incident form, specifying a URL of:

http://<SDE ServerName>/SDE/RemoteAssistance.asp

The elegant bit came from hacking the Microsoft Remote Assistance htm page to accept a querystring parameter such that I can prefill the Machine Name with the machine name of the asset selected on Incident form. I’ll explain how to do that in the next post.

As always, comments gratefully received – thanks for reading.