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!

Advertisements

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.

Purchase Request Tax Field Bug – Workaround

As many of you will already be aware there is a bug in the Purchase Request module with the Tax field that prevents you editing it (you receive bundles of JavaScript errors). This is caused because some genius thought it would be a good idea to use the % symbol in a field name.

I logged this with support and received the following response:

“Defect Workaround: place a “Text field” over the field “TAX” and make sure the background color of that new field is the same as the background of your form”

The status of this is: “This issue will be considered for a future release.”

There is however a much better (at least in my opinion) workaround which involves renaming the alias and display name of the Tax field in DB Admin to anything that doesn’t include a % in the name.

Now you can edit it as much as you like.

Microsoft SQL Reporting Services – Enabling Service Desk Express Print Preview

If you are using Microsoft SQL Reporting Services as your enterprise reporting tool you will probably have already developed a bunch of reports that query the Service Desk Express database. Developing reports for use with Service Desk Express and even completely migrating away from Crystal is easy enough until you come to enabling the print preview type functionality.

Sure you can generate an Incident Report that takes a parameter of IncidentNo and returns all the data about that incident in a perfect format, but how do your support staff launch that report from a given incident ticket?

In a previous post I discussed the use of a System Parameters module, and in this post I am going to use that module in conjunction with a calculated field to enable the print-preview functionality without the use of the Program Launcher application.

Solution

Assumptions:

  • We have already created an appropriate incident print preview report called “HDPrintPreview” that accepts a parameter of IncidentNo.
  • That report is published in a directory called “SDE” on your report server.
  • We have a System Parameters module as discussed in the previous post. If you don’t have this module this technique will still work but it means that if you need to change the name of the report or report server then you need modify the calculated field which can only be done out of hours.

Having made these assumptions we need to create a new system parameter called “Incident Print Preview Report URL” with a parameter value of:

http://<ReportServer>/ReportServer?%2f<Report Directory>%2f<Report>&<Parameters>=

where <ReportServer> is server where Microsoft SQL Reporting Services is installed, <Report Directory> is the directory on the report server where the report is located, <Report> is the name of the report, and <Parameters> are the parameters that need to be passed to the report.

So, let’s say that we have a report server called GANDALF (sorry all mine are named after Lord Of The Rings characters), your parameter value would be:

http://gandalf/ReportServer?%2fSDE%2fHDPrintPreview&IncidentNo=

So far so good…

Now using DB Admin we need to add a calculated field to the Incident module called ReportURL with a formula of:

(SELECT "PARAM_VALUE" + CAST("BASE"."SEQUENCE" AS NVARCHAR(10)) FROM "_SMDBA_"."TBL_PARAMS" WHERE "PARAM_NAME" = 'Incident Report URL')

as shown below:

ReportURL Calculated Field

Report URL Field

Basically, all this calculated field does is append the Incident No to the end of the URL/Parameter Value we specified earlier so that when, for example, you open Incident 1234, the ReportURL field will show:

http://gandalf/ReportServer?%2fSDE%2fHDPrintPreview&IncidentNo=1234

So now for the final bit to make it all work.

Add the ReportURL field to your selected Incident form using form customisation and also add the Display Link button to the form as your new print preview. The Display Link button is available via the buttons menu in form customisation.

Save the form and open an incident using the saved form and click the Display Link button you added. You should find that the SQL Reporting Services report should open automatically, showing the appropriate incident details.

As always feedback welcome – hope it proves useful.

Calculated field error in purchase request module

A little gotcha that I came across awhile ago is there is an error in the Total Cost calculated field in the Purchase Requests module that forgets to take into account if a Purchasing Item is active or not. As many organisations prefer to use the InActive flag as opposed to allowing users to delete records, this can lead to erroneous reporting. Thankfully, it is easily fixed…

Open DB Admin and expand the Purchase Requests module. Right-click on the Total Cost field and select Modify Field from the popup menu. Change the SQL from:

(((select ISNULL(SUM(CHILD."PRICE"*CHILD."QUANTITY"),0) from "_SMDBA_"."_PI_" as CHILD , "_SMDBA_"."_CATALOG_" as CATALOG where CHILD."SEQ_PR" = BASE."SEQUENCE" and CHILD."CATALOG#" = CATALOG."SEQUENCE" and CATALOG."TAXABLE" = 1) * (1+(ISNULL(BASE."TAX_%",0)*0.01) ))+(select ISNULL(SUM(CHILD."PRICE"*CHILD."QUANTITY"),0) from "_SMDBA_"."_PI_" as CHILD , "_SMDBA_"."_CATALOG_" as CATALOG where CHILD."SEQ_PR" = BASE."SEQUENCE" and CHILD."CATALOG#" = CATALOG."SEQUENCE" and CATALOG."TAXABLE" = 0)+ISNULL(BASE."SHIPPING_COST",0))

to:

(((select ISNULL(SUM(CHILD."PRICE"*CHILD."QUANTITY"),0) from "_SMDBA_"."_PI_" as CHILD , "_SMDBA_"."_CATALOG_" as CATALOG where CHILD."SEQ_PR" = BASE."SEQUENCE" and CHILD."CATALOG#" = CATALOG."SEQUENCE" and CATALOG."TAXABLE" = 1 and CHILD."_INACTIVE_:" = 0) * (1+(ISNULL(BASE."TAX_%",0)*0.01) ))+(select ISNULL(SUM(CHILD."PRICE"*CHILD."QUANTITY"),0) from "_SMDBA_"."_PI_" as CHILD , "_SMDBA_"."_CATALOG_" as CATALOG where CHILD."SEQ_PR" = BASE."SEQUENCE" and CHILD."CATALOG#" = CATALOG."SEQUENCE" and CATALOG."TAXABLE" = 0 and CHILD."_INACTIVE_:" = 0)+ISNULL(BASE."SHIPPING_COST",0))

Save the field after testing it and you are good to go. Happy reporting.