RA: Pass Workstation and Username Parameters to Offer Remote Assistance

For those of you who successfully use the shortcut for Offer Remote Assistance (ORA), you’ve probably wanted to automate it just a little more with parameters at some point or another. You may have even come across EdmSaleBoy’s Usenet Post titled “Programatically Offer Remote Assistance.” I did a few times but it didn’t do exactly what I wanted to. Though I appreciated EdmSaleBoy’s code extraction skills, I didn’t find the solution of overwriting UnsolicitedCUI.htm to be very elegant so I spent some hours looking into alternatives.

ORA is a bit of a programming pain because it requires client-side Javascript and it’s picky about what it will and will not let you do. I wanted to find a way to call ORA from a webpage and wondered how I would pass some variables to the script. The command line was not cooperating with me so I thought that perhaps I could hack together something with javascript and Microsoft.XMLHTTP but ORA denied me access. After some hackery, I discovered the joys of objSAFClassFactory.ExtraArgument.

Using objSAFClassFactory.ExtraArgument, I was able to dynamically pass the workstation name and username (note: the username MUST be in the domain\username format or it won’t work.) So now I present to you the following code, which you can save as cmdOfferRemoteAdmin.htm under the directory %windir%\pchealth\helpctr\System\.

Remote Assistance

Once you saved the file in the proper location, you can call it by going to %windir%\PCHEALTH\HELPCTR\Binaries\HelpCtr.exe -url hcp://system/cmdOfferRemoteAdmin.htm -ExtraArgument “WORKSTATION=winxpsp2&USERNAME=testlab\chrissy”

The downside to this code is that there’s little to no error handling. If just a blank “Windows Help” page appears, you’ve done something wrong. Make sure the computer you are attempting to connect to is pingable and that the username is in the correct format (domain\user). Also, make sure you can get the regular Offer Remote Assistance to work before calling this more advanced technique. If you are having trouble with ORA, this posting may provide some help.

Chrissy is a Cloud and Datacenter Management & Data Platform MVP who has worked in IT for over 20 years. She is the creator of the popular SQL PowerShell module dbatools, holds a master's degree in Systems Engineering and is coauthor of Learn dbatools in a Month of Lunches. Chrissy is certified in SQL Server, Linux, SharePoint and network security. You can follow her on Twitter at @cl.

Posted in Security
12 comments on “RA: Pass Workstation and Username Parameters to Offer Remote Assistance
  1. Zac says:

    The way to take away the Accept dialog is the following:

    In the c:\windows\pchealth\HelpCtr\System\Remote Assistance\helpeeaccept.htm you need to find these lines:

    btnAccept.disabled = false;
    btnDecline.disabled = false;

    to this

    btnAccept.disabled = false;
    btnDecline.disabled = false;

    I found this courtesy of the following forum:


    The thread also shows how to disable the Take Control prompt but I haven’t tried that yet.

  2. Zac says:

    OK, I followed the instructions on the thread and also was able to disable the Accept dialog for Take Control.

    Per the thread I had to do the following:

    change the file %WINDIR\pchealth\HelpCtr\System\Remote Assistance\Interaction\Server\TakeControlMsgs.htm

    find these lines:
    idExpert1.innerText = vArgs[0];
    idExpert2.innerText = vArgs[0];
    idExpert3.innerText = vArgs[0];

    Then add the following line below, but before the close bracket.
    // Added to allow take remote control of PC

    I tested this and it works in a non-domain environment on a LAN between 2 XP Pro 32 bit machines.

  3. MarkyMark says:

    ok…This looks like a handy tool but can the process be reversed? I want a short cut on each of my users desktops asking for remote assistance. This would then produce a pop up your email on my end. Is this possable? They all sit behind NAT on networks all over the contry so the tool above doesn’t really help me due to the NAT on there end.


  4. Steve says:

    Change the code in C:\WINDOWS\PCHEALTH\HELPCTR\Vendors\CN=Microsoft Corporation,L=Redmond,S=Washington,C=US\Remote Assistance\Escalation\Unsolicited\unsolicedrcui.htm to include a variable grabber and enter the variable as the default value in the idComputerName box… Seems logical anyway…

  5. Dave says:

    I’m sorry, I’m not good with HTML, can you give me some idea where I can get started in that file?

  6. edward says:

    i edited the htm files and be able to remote to client computer without user clicking OK, but if client have a computer locked then you can’t do anything with it. is there anyway we can hit the control +alt +delete to log in? thanks

  7. chris says:

    this looks very promising but i’d like to simplify it a bit. i dont quite need the automation of passing the username (although that worked successfully). can i chop out the code requiring the username and just pass the computername? The goal is to open help center with the computer field populated, and let the choosing of the user session be a manual process from there forward.

    thanks for any assistance, nice effort too, not much posted on how to do this.


  8. Ron says:

    That is a very nice example of how to interact with Remote Assistance. I incorporated something similiar in a program I wrote. Passing the machine name using oSAFClassFactory.ExtraArgument to a slightly modified version of unsolicited.htm allows it to still poll the remote machine for active users. If anyone is interested Remote Assistance Helper can be dowloaded at http://www.digitaltaproom.com. It’s free by the way.

  9. Kevin says:

    This is exactly what I’ve been looking for!!! But I’m getting the dreaded Blank Help page… is there any way to trace the code to figure out where it is going wrong?

    I am able to “Offer remote assistance” when I type the fields in manually, but I want that piece to be automated via the parameter passing… If I could get this to work I’d be a happy guy!

  10. Barlug says:

    have somebody found the way to reverse the process? I mean to pass values to “ask for remote assistance” ?

  11. Larry says:

    Very nice bit of scripting. However, if you are having trouble (getting the blank help page) it is because there are errors in the above script. First, the line about 3/4 of the way down that begins “var szRAURL =” does not have the backslashes escaped. Change all the “\” in the path to “\\”. Also, there is something amiss in the parsing of the domain\username from the ExtraArgument. I didn’t bother debugging that since there are other ways to pass variables to a script. Try hardcoding your workstation, username, and domain on the line that begins “objInc.RcTicket =”. If that works, you should be good. You’ll just have to decide how you want to get those values passed in. Either fix the parsing above or skip the ExtraArgument stuff (in the script and in the calling URL) if you have a different approach.

    However, this is a very helpful piece of script. It saved me a lot of time when I almost gave up on deconstructing the script in UnSolicitedRCUI.htm.

    Thanks Chrissy!

  12. Don’t anthropomorphize computers – they hate it :))

1 Pings/Trackbacks for "RA: Pass Workstation and Username Parameters to Offer Remote Assistance"
  1. […] de tekst door een script worden ingetypt. Ook heeft iemand het mogelijk gemaakt om met een extra script wel de hostname mee te geven. Tenslotte kan het door Remote Assistance gebruikte bestand […]

Leave a Reply to edward Cancel reply