Forum / Remote Desktop Manager - Macro/Script/Tools

Typing Macros and variables for Credential Entries

  • Create an Issue
  • Cancel

Is there a variable I can use in the Typing Macro to reference the password that exists within a credential entry?

I am wanting to see if there is a way that I can create a credential entry and put a password into it and then reference that password from a Typing macro in the After Connect Macro of a session.

Scenario: I have some PuTTY sessions that connect to Cisco equipment (switches, firewalls, routers, etc.) Once I connect to them, I need to enter my enable password to gain elevated privileges. To do this now, I have a typing macro set up on each of my PuTTY sessions. My enable password among the devices is the same, so I'd like to have it set in a single credential entry so that when I change it I don't have to modify 30+ sessions to update the password. I just need to know if I can somehow use a variable to pull the password from an existing credential entry and put that into my Typing Macro instead of using the $MACRO_PASSWORD$ variable and have to set that password on each of my sessions.

Clock5 yrs

hmmm

maybe setting the credential in the Tools tab, then using the $TOOL_PASSWORD$ variable...



Maurice Côté

signaturesignature

Clock5 yrs

I don't see where in the Tools tab I can set a credential... ?

Clock5 yrs

Hello,

In the properties of the sessions

2015+10+13+11+15+26

Best regards,



Maurice Côté

signaturesignature

2015-10-13_11-15-26.png
Clock5 yrs

Ok, so I have created a credential entry called Cisco Enable. In the tools section, I have selected "Use credential repository" and selected 'Cisco Enable' from the drop down.

RDM+Tools

Then my macro

RDM+Macro

I used to have $MACRO_PASSWORD$ instead of $TOOL_PASSWORD$. Right now, when the macro is run, I'm getting an error from my network device that the password is invalid. Am I doing this correctly? Is there any way to see what is being typed for the password to verify it is correct?

Another question... Can I create my typing macro somewhere else? When I go to Macros/Scripts/Tools it doesn't seem to give me an option to do a simple typing macro. Also, is there a way to make the macro force the focus to the session? If I open a putty session and then click on another window (say a chat window, for instance) the macro will type into whatever window the current mouse focus is on, so I could inadvertently send a password to someone else. It would be nice if the macro would bring the session window to focus before typing...

RDM Tools.jpg
RDM Macro.jpg
Clock5 yrs

Hello,

Well, I have tested and the variable resolution is not handled at this time by this area of the code. I will log a bug

The only solution at this time will be to use the MACRO_PASSWORD field, sadly each entry will need to be maintained. Luckily, the Batch Edit (General Settings) does allow you to modify multiple entries at once.

Sorry about that,



Maurice Côté

signaturesignature

Clock5 yrs

Thank you. Can you give any estimate on a timeline for bug resolution?

Clock5 yrs

Can you also respond to my other question below?

Can I create my typing macro somewhere else? When I go to Macros/Scripts/Tools it doesn't seem to give me an option to do a simple typing macro, it's all PowerShell or command line, etc.

Also, is there a way to make the macro force the mouse/keyboard focus to the putty session? If I open a putty session and then click on another window (say a chat window, for instance) the macro will type into whatever window the current mouse focus is on, so I could inadvertently send a password to someone else. It would be nice if the macro would bring the session window to focus before typing...

Clock5 yrs

Hello,

Please consult http://help.remotedesktopmanager.com/macroscripttools_overview.htm, the Macro type is exactly the same mechanism as the session's typing macro. Remember that a Macro/Script/Tool is run "against" a session and allows to access the information from the session using the variables.

For your second question, its not possible at this time. I like to say that when you use a typing macro its best to launch it then let go until its complete. For solutions that allow to select windows please look at AutoIT or AutoHotkey

Best regards,



Maurice Côté

signaturesignature

Clock5 yrs

Hello.

I've been using this option last days to configure +120 SSH sessions with a "sudo -i" command line after session is connected, and it works ok.
RDM+AfterConnect

Anyway, I suppose that this bug will be fixed and then we will use... ¿$PASSWORD$ or $TOOL_PASSWORD$?

Thanks in advance.
Regards,
Héctor

RDM_AfterConnect.jpg
Clock5 yrs

Hector: $TOOL_PASSWORD$

Maurice, is there any update on this? I am now running 11.0.9 and I am still having the same issue. Do you know when the bug will be fixed?

Clock5 yrs

Hello Ben,

I will take a look at this as soon as possible and get back to you when I have more information.

Regards,

Hubert Mireault

signaturesignature

Clock5 yrs

Hello,

It seems to work on version 11.0.9.0. Could you make sure that for the connection you're using as well as the credential entry set in the tools section you have gone in the security tab and checked "Allow password in variables"? You need to check it for both of them or it will not work.

Regards,

Hubert Mireault

signaturesignature

Clock4 yrs

I just checked that and still no luck. I also tried simply specifying the password in the tools section, instead of linking to a credential entry, but still it keeps saying invalid password. Is there a way I can debug and see what exactly is being sent across?

Clock4 yrs

Hi Ben,

You could follow the instructions in this help topic or do something similar to achieve this http://help.remotedesktopmanager.com/index.html?tipsandtricks_variables.htm Just a note that it's a little outdated and it should say in the "Security" tab rather than the "Advanced" tab for the checkbox, as you've previously seen.
This would allow you to see the resolved variable.

Regards,

Hubert Mireault

signaturesignature

Clock4 yrs

Hubert I apologize for resurrecting an old thread, but I've just come back to this. I've done additional testing and here is what I have come up with.

To test this, I set the typing macro to simply be: $TOOL_PASSWORD$

When I execute the typing password, it spits out the password correctly, as I would expect. However, when I set the macro to do the full command, my device tells me incorrect password. Here is what I am sending: enable{ENTER}{DELAY}$TOOL_PASSWORD${ENTER}

Thoughts? How do I test this further to verify the macro is not somehow modifying the password as it's sent? I did also remove the final {ENTER} from the macro as well, thinking perhaps that could be causing issues, and manually pressed enter after the password was entered, but that did not do anything either.

For what it's worth, if I put this into a separate macro and run that, it seems to work fine. It's just the typing macro defined within the session itself does not work properly.

Clock3 yrs

@Ben Miller,

Could you post some print screens of your configuration and your session, I would like to test this in our environment.

Best regards,



Jeff Dagenais

signaturesignature

Clock3 yrs

Yes, I apologize for the vague comment. Here's the full on rundown.

I have a simple Putty session for logging into a Cisco device. I want to enter enable mode automatically after login. Initially, I set this up with a typing macro defined within my Putty session. If I used $MACRO_PASSWORD$ and then entered the password into the Macro Password field on the Events tab, everything worked fine. However, I don't want to have to modify every single Putty session to update the Macro Password when I change my enable password.

So, I created a credential in my credential repository for my Enable password:

image

I then defined this credential in the Tools tab:

image

I then set the Security tab to allow password in variable:

image

I then went to the Events tab and set my typing macro to use this credential:

image

However, when I use this method, it seems that what is being sent across is not correct, because I get an error saying incorrect password. If I take off the whole command and simply put in $TOOL_PASSWORD$ without the enable{ENTER}{DELAY} etc, then the password would be displayed correctly. I cannot show you this, unfortunately, because I do not want to reveal the password.

What I've found is that if I create a new Macro entry and then link to that Macro in the events screen, everything works as expected:

image
image

I'm fine with using this method, as it actually gives me a bit more flexibility, in case I ever needed to change the Macro itself. It was a bit of a frustrating journey to get to this point, but I'm happy with it for now. You might want to see if you can reproduce this behavior, though, because I imagine I'm not the only person who has come across this.

Credential.jpg
Tools.jpg
Security.jpg
Events.jpg
Macro.jpg
Macro Link.jpg
Clock3 yrs

Hello,

I tried reproducing this with your exact setup but I've been unable to, the tool password always sends properly.

You could try testing this with a command line entry that opens notepad and then types your command inside of it (I attached an example to this post).

I tried with the following password entry:
2016+12+02+9+20+18+AM

I get the following result:
2016+12+02+9+20+38+AM

Regards,

Hubert Mireault

signaturesignature

Notepad.rdm
2016-12-02 9-20-18 AM.jpg
2016-12-02 9-20-38 AM.jpg
Clock3 yrs

At this point, I have a suitable solution. Like I said, I think having a linked macro actually gives me more flexibility because if I ever need to change the macro itself for all those connections, I can do it in a single spot. I am happy with what I've got in place now and would prefer not to pursue this any further.

Thanks so much for your help!

Clock3 yrs

Experiencing the same issue in 12.0.8.0.

If I use the $TOOL_PASSWORD$ variable directly in the entry macro area like you tried, mine returns nothing at all (allow password in variable is set).

If I create a Typing Macro with the $TOOL_PASSWORD$ variable, it enters is correctly. Literally just changing the Macro to Link and putting the macro text in a linked typing macro.

Clock3 yrs

Hello,

Have you tried to set the Initial wait value higher on the macros? 4-6 second should do it.

If you did, which type of session are you executing the macros on ?
image

Best regards,

Alexandre Roy

signaturesignature

Initial wait.jpg
Clock3 yrs

Just tried that, same result. It appears the variable is empty. Also, you are using a typing macro link, which works. I'm talking about when you do it without the link directly in the entry.

Clock3 yrs

Hi again,

Is it possible that you are using credentials repository to get your password on the session then?

It is the only way that I found how to reproduce it so far.

image

Best regards,

Alexandre Roy

signaturesignature

Credentials repository event.jpg
Clock3 yrs

Ah, yes, good catch. I am using via Credential Repository.

Clock3 yrs

Hello,

The issue has been reproduced on our current version, It seems to be caused by credentials entry made on version 12.0.0.0 + from what we know.

Basicly, we were able to set "Password Variable" with the old credentials entry on an older version like 11.7.6.0 and we are investigating right now why this is not possible at the moment.

A ticket as been sent to the engineering team to fix the issue.

We'll give you an update on when the fix will be done.

Best regards

Alexandre Roy

signaturesignature

Clock3 yrs

Excellent, glad you were able to reproduce, thanks!

Clock3 yrs

Hi,

The issue is now fix and is available to use again on the current version.

You will be able to find the option in the advanced tab as displayed on the screenshot.

Best regards,

image

Alexandre Roy

signaturesignature

Password Variable.jpg
Clock3 yrs