Forum / Remote Desktop Manager - Support

RDM, playlists and macros

  • Create an Issue
  • Cancel

Good morning. Each month, we patch/update our servers, so I have different playlist that connect to a different series of servers (depending on patch schedules, etc.). These are different flavors of Windows Server OS’s and all are using RDP sessions to connect. I decided to check out the macro capabilities (with regards to playlists) as it would offer some benefits to our processes. But I seemed to have some issues running macros against playlists and I wanted to see if maybe I’m doing something wrong. There are a couple of things that I would like to accomplish with playlist macros. When logging on to our Windows Servers, a login banner appears (i.e., legal notice). The macro I created is simple, after establishing a RDP session, press ENTER (to get by the legal notice), open a command prompt and launch Windows Update. I have another macro for post-update server checks (press ENTER and run services.msc) – but I’ll stick with the first macro in this thread. BTW, the DELAY variable is set to 2,000ms.

Macro:
{ENTER}{DELAY}command{ENTER}{DELAY}{DELAY}wuapp.exe startmenu{ENTER}exit

The above macro works 95% of the time when I use it with a single RDP session. Sometimes I’ve noticed that once a RDP session is established (using the macro with a single RDP session), the remote OS “focus” changes before the macro runs so when the macro tries to type in the letters (“command”) and press ENTER, the remote desktop isn’t always the focus so when the macro tries to type the letters in, it doesn’t always work. That is with a single RDP session. That behavior also occurs when I run the macro against a playlist, but it occurs on pretty much every RDP session (nothing beyond the first ENTER is executed).

Q. Is there any way (with a playlist macro) to run these commands using some other method. Or how can I make the remote desktop the “focus” of the RDP session? I tried the focus thing but that seems to only apply “focus” to the local desktops and not the remote RDP session.

Q. Is it possible to press the “Windows-key” remotely via a macro (which might solve the issue for me)?

Q. (issue): When running a macro via playlist, it only runs on the focused window on the local system (not on RDM or the RDP session). While the playlist/macro was executing, I switched to a different program (locally) that was running on my local desktop (notepad) and the RDM macros ran in notepad (not in the RDP sessions). It was typing the letters, pressing ENTER, etc. in notepad. Is there any way to tell RDM to run the macro in the RDM/RDP session itself and not on the local desktop / locally focused window (so that I can do other work while the playlist/macro is running)?

Q. Can I run a script the same way (that would solve my problems)? If I can run a script (instead of just macro commands), then I can have the script run the commands that I need to run.


Thanks in advanced,
STGdb

Clock3 yrs

STGdb wrote:

Q. Is there any way (with a playlist macro) to run these commands using some other method. Or how can I make the remote desktop the “focus” of the RDP session? I tried the focus thing but that seems to only apply “focus” to the local desktops and not the remote RDP session.

Yes, RDM Agent, see Q. #4 below

STGdb wrote:

Q. Is it possible to press the “Windows-key” remotely via a macro (which might solve the issue for me)?

With RDM Agent, you simply execute a batch file therefore you shouldn't need special keys.

STGdb wrote:

Q. (issue): When running a macro via playlist, it only runs on the focused window on the local system (not on RDM or the RDP session). While the playlist/macro was executing, I switched to a different program (locally) that was running on my local desktop (notepad) and the RDM macros ran in notepad (not in the RDP sessions). It was typing the letters, pressing ENTER, etc. in notepad. Is there any way to tell RDM to run the macro in the RDM/RDP session itself and not on the local desktop / locally focused window (so that I can do other work while the playlist/macro is running)?

Typing macros will always act upon the focused window (RDM, Notepad...). This is the nature of the beast of a typing macro.

STGdb wrote:

Q. Can I run a script the same way (that would solve my problems)? If I can run a script (instead of just macro commands), then I can have the script run the commands that I need to run.

Closing the pop-up requires a typing macro. The remainder of the command could be a simple batch script that executes via RDM Agent and hence not be susceptible to the changing of the focused application. You would first need to open the sessions, make sure all the prompts are gone, then run the script via RDM Agent on all opened sessions. This of course requires that RDM Agent is installed on all machines (small standalone install).


PowerShell might also be an option...

Best regards,

Stefane Lavergne

signaturesignature

Clock3 yrs

Thanks for the detailed feedback. Yes, I can use the RDM Agent on our remote systems and if that works, that solves my issues. I didn't realize what the RDM Agent did, your explanation was great.


I downloaded the RDM Agent components from your website and I was looking at the document on how to install the RDM Agent. It looks like the files that I downloaded from the website are v1.0.2.0. In the document I linked, one of the methods to install the RDM Agent is to manually copy the files to the remote system from my locally installed RDM client:


Copy the files Devolutions.Utils.dll, Devolutions.Windows.Utils.dll and RDMAgent.exe from your installation folder on the remote host


When I compared the files that I downloaded to the files that the document tells me to copy to the remote system manually, the version numbers are the same but the file sizes and dates are different. I (personally) would rather use the "newer" files and copy them over manually, but when I run the RDMagent.exe file on the remote system, it prompts me whether I was to start it (register it).


Q. Is there any command-line to silently install/register the RDMagent.exe if I copy the files over to the remote system manually? I guess that I can use the MSI and then copy the newer files to the remote system and overwrite the MSI-installed files, but I wanted to check if there was a command-line for RDMagent.exe first.


Thanks again

Clock3 yrs

RDM Agent rarely changes hence the msi being somewhat old. Chances you better off using the new version of the files. I will also add a request to create a refresh RDM Agent installer.

As for the command line, you have the follow switches:


RDMAgent.exe [/run | /install | /uninstall] [/q]


/run - RDM Agent will run (once) and not prompt to install/register or anything like that
/install - RDM Agent will be registered as a StartUp application and start automatically
/uninstall - opposite of /install
/q - RDM Agent will quit after performing the action (install or uninstall)

Note that /install & /uninstall require elevated privileges to perform the registration. If you launch the RDM Agent via non-elevated prompt, it will automatically restart with elevated (prompt if the system is configured) and perform the action.

Hope this is clear enough. We will also add it to the documentation of RDM Agent.

Stefane Lavergne

signaturesignature

Clock3 yrs

That's perfect - thanks again. I can use SCCM to push the files out to the remote systems (servers) manually and now I have a command-line to install it with.


Much appreciated!!

Clock3 yrs

To follow up (on RDM Agent), can I (automate) running a script (which presses ENTER) then run something against RDM Agent with a playlist? In other words, I have a Playlist "script" that runs against a Playlist (all it does is delay and then press ENTER). Once that is done, I would like to run something against the RDM Agent that is on the remote host that I just established a RDP session to. Is it possible to automatically run something against a RDM agent at that point, or is manual intervention required to run a script/command line against a RDM Agent when you are connecting to multiple remote RDP sessions via a Playlist?


Thanks

Clock3 yrs

I noticed the following in the 11.9.0.0 (RDM 12 BETA) change history:

Improved the playlist to be executed through the Agent

The improvement mentioned in the change history of the new BETA, is the improvement related to what we discussed in this thread (above)?

Thanks

Clock3 yrs

Yes, but it's not quite done yet we are still missing a few things. Not as simple as first thought so it will take some more time. Will be done by the time v12 is out.

Stefane Lavergne

signaturesignature

Clock3 yrs

Good news. The next beta release will have an "Execute Against Opened (via Agent)" action in the dashboard. The feature is functional but limited.

- Create a playlist of Marcos/Scripts/Tools that you want to execute
- Start your RDP sessions (via a playlist or manually)
- Select your playlist and select "Execute Against Opened (via Agent)"

Limitations/notes
- Not all Marcos/Scripts/Tools have been tested
- If RDM is not installed on the RDP machine, then we will try to quick-script the Marcos/Scripts/Tools (easy for CMD & RUN for example) and run them using the RDM Agent otherwise you will see a Windows error "How do you want to open this file?...rdmj"
- We only currently only support, "Execute Against Opened (via Agent)". The "via Agent" will eventually be dropped as we plan to allow SSH sessions to accept scripts and the like. So, in other words, if the open sessions support the execution of a Marcos/Scripts/Tools then execute it against the session, if not skip it.

Let me know what you think. Improvements/issues/suggestions.

Best regards,

Stefane Lavergne

signaturesignature

Clock3 yrs

AWESOME - can't wait. Thank you very much!!

Clock3 yrs