Resolved

Set macro password

avatar

Hi!

First as context: I want to execute a command on a remote host. Actual solution is a ssh session with an "After open" macro and closing this session after execution.
The command has an password as parameter.
Using a linked entry, does not work, so I want to set the macro password with an powershell script.

How can I set the macro password with a powershell script?
The secure password is stored in $session.Events.AfterConnectionTypingMacroSafePassword but setting does not work.
I know the Set-RDMSessionPassword command. Is there something simmilar for the macropassword?

CU,
Timo

All Comments (7)

avatar

Hello,

Thank you for contacting us on that matter!

Have you enabled the Allow password in variable option for the linked credential entry? All involved entries must have this option enabled.
https://docs.devolutions.net/rdm/kb/troubleshooting-articles/unable-use-password-variable

There is no cmdlet available to set the password in this property. I can ask our developer team if they have a solution about this.

Best regards,

Érica Poirier

avatar

Hi

Thanks for the answer.

If I set the Macro passwort in the RDM the script is working without a problem. The problem is, to set the macro password via a powershell script.
We create alle entries with powershell scripts. The prefered solution is to use a linked credential entry, but I have no idea how.
The credentials for the session are not the same that are used in the macro.
As there are only variables for the entry, the parent and the folder I see no way to reference a total different credential entry.

I will try to use a custom field as a workaround.

CU,
Timo

avatar

Hello,

Thank you for your feedback.

You can use this command to set the password in the AfterConnectionTypingMacroPassword property.

Set-RDMSessionProperty -ID $entry.ID -Path 'Events' -Value '123456' -Property AfterConnectionTypingMacroPassword 


Let us know if that helps.

Best regards,

Érica Poirier

avatar

Hello,

If you want to use a different credential for the Events, you can use the Tools feature to link a credential entry and use the Tools variables instead of setting the password in the Macro password property.





Best regards,

Érica Poirier

05bdb2e3-3cac-4265-b0c5-5a9aeba7ba2d.png

f29711a8-656d-46f0-8c32-364608934dc2.png

avatar

Hi!

Thanks a lot!
Set-RDMSessionProperty works like a charme!
The solution via the tools feature I will try in the future.

CU,
Timo

avatar

Hello,

Thank you for your feedback.

That's good news it work as expected.

Best regards,

Érica Poirier

avatar

Unfortunately, there isn't a direct `Set-MacroPassword` cmdlet equivalent for SSH macros in PowerShell. If `$session.Events.AfterConnectionTypingMacroSafePassword` isn't working, you may need to manually interact with the macro configuration or use alternative methods like modifying the session settings via scripting in the application’s API or configuration file. Between part-time work and school, I found it difficult to keep up with all my homework. I used https://academized.com/do-my-homework for help, and the results were fantastic. The assignment was well-researched, clear, and met all the instructions. The writer was responsive and ensured that everything was perfect before submission. I’ll definitely return to academized whenever I need assistance with my homework.