Dave_Thomas Absent Member.
Absent Member.
1812 views

Using Remote Command Execution to run app on remote server which displays on specific desktop

I need HPOO to display a heads up  alert notification on a remote server. I have an existing form which accepts severity and other parameters associated with the alert which I want it to run but the catch is it has to do it on a particular desktop.

 

I can determine the desktop(user id) using the 'Get Active Users' step but the 'Remote Command Execution' step doesn't appear to have the ability to define desktop to display it on.

 

PSExec has a -i switch which allows you to specify the desktop, but it requires the use of the $ADMIN share and these boxes are locked down drum tight and I know that's not going to be allowed.

 

Any suggestions?

 

Labels (1)
0 Likes
8 Replies
SwatiShah Absent Member.
Absent Member.

Re: Using Remote Command Execution to run app on remote server which displays on specific desktop

Don't know if this  would help... but Powershell script can be run on target machine (hostname). I had similar situation so username password I used was the one that was allowed to run the script from that target machine. I definitely had to add that user in local group on target mahcine  with monitoring access as I was monitoring their CPU usage.

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Using Remote Command Execution to run app on remote server which displays on specific desktop

Hi Dave,

 

There is an old command to send messages to users which was

net send

Starting from Windows Vista and Windows 2008 they have added a new command called msg.exe

 

It alow you to send messages Async (the command exit without user interaction) and sysnc (which user has to close the Popup windows for your command to exit)

Sync messages will be useful as you can add  it as a wait operation before excuting the whole workflow.

You can send messages to the console session direct without querying Active Users as the example below

 

msg /w console hello

 The full instructions for msg command:

Send a message to a user.

MSG {username | sessionname | sessionid | @filename | *}  [/SERVER:servername] [/TIME:seconds] [/V] [/W] [message]

  username            Identifies the specified username.
  sessionname         The name of the session.
  sessionid           The ID of the session.
  @filename           Identifies a file containing a list of usernames, sessionnames, and sessionids to send the message to.
  *                   Send message to all sessions on specified server.
  /SERVER:servername  server to contact (default is current).
  /TIME:seconds       Time delay to wait for receiver to acknowledge msg.
  /V                  Display information about actions being performed.
  /W                  Wait for response from user, useful with /V.
  message             Message to send.  If none specified, prompts for it or reads from stdin.

 

 

Regards,
Mahmoud Ibrahim
https://www.itmthoughts.com
New version of Mahmoudthoughts witten by other IT experts
  • Say thanks by clicking the "Kudos! Star" which is on the left.

  • Make it easier for other people to find solutions, by marking my answer with "Accept as Solution" if it solves your issue.
  • Dave_Thomas Absent Member.
    Absent Member.

    Re: Using Remote Command Execution to run app on remote server which displays on specific desktop

    Hi Mahmoud,

                             thanks for your reply but I had hoped to display the window I developed so that it can track whether the message has been acknowledged etc. either via a database or even just a central log file.

     

    Regards,

    Dave Thomas

    0 Likes
    Micro Focus Expert
    Micro Focus Expert

    Re: Using Remote Command Execution to run app on remote server which displays on specific desktop

    Hi Dave,
    You can check this http://www.netsupportnotify.com/ it has a traceable log.

    Please let me know your feedback..
    Regards,
    Mahmoud Ibrahim
    https://www.itmthoughts.com
    New version of Mahmoudthoughts witten by other IT experts
  • Say thanks by clicking the "Kudos! Star" which is on the left.

  • Make it easier for other people to find solutions, by marking my answer with "Accept as Solution" if it solves your issue.
  • 0 Likes
    Dave_Thomas Absent Member.
    Absent Member.

    Re: Using Remote Command Execution to run app on remote server which displays on specific desktop

    Hi  Mahmoud,

                         thanks for your response.

    There are a number of problems using an alternative to my app. The first is the difficulty in getting approval for third party software. This network is locked down like you wouldn't believe, but it does have HPOO. Secondly my app as well as having db access and logging allows me to define the colour of the popup according to the severity of the alert and has a configurable timeout which when exceeded caused the popup to flash to hopefully further bring it to the attention of the operator. So what I need is some way of specifying the the user desktop on which it is to display.

     

    Regards,

    Dave Thomas

    0 Likes
    Micro Focus Expert
    Micro Focus Expert

    Re: Using Remote Command Execution to run app on remote server which displays on specific desktop

    Hi Dave,
    I think the best solution to launch your command on active session without access admin shares is to keep a copy of psexec command locally on each machine.
    When Remote command execution OO step calls the file it will call it as local command; no admin shares needed.

    The ps command example to launch in the console session (always has session IID of 0)

    psexec.exe -s -i 0 cmd.exe
    Regards,
    Mahmoud Ibrahim
    https://www.itmthoughts.com
    New version of Mahmoudthoughts witten by other IT experts
  • Say thanks by clicking the "Kudos! Star" which is on the left.

  • Make it easier for other people to find solutions, by marking my answer with "Accept as Solution" if it solves your issue.
  • 0 Likes
    Dave_Thomas Absent Member.
    Absent Member.

    Re: Using Remote Command Execution to run app on remote server which displays on specific desktop

    Hi Mahmoud,

                      sounds like a reasonable alternative, all I have to do is get permission to install PSExec on these boxes. That's the hard part and may take a while, but if I can I certainly will give it a try.

     

    Appreciate for your help,

    Dave

    0 Likes
    Etsushi
    New Member.

    Re: Using Remote Command Execution to run app on remote server which displays on specific desktop

    I'm having simmilar problem. I'm trying to use OO to execute remote command on a Server 2008 machine. But i'm getting several security issues. Does anybody know what are the exact prerequisites to run commands remotely using WMI?

     

    Thanks,

     

    Erik

    0 Likes
    The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.