Update password when before Open script is finished

Implemented

Update password when before Open script is finished

0 vote

avatar

If you run a script (Before open setting) that updates the password that the session uses, you have to close the session and open it again before the password that the session uses is updated.
Therefore, I hope you can add an “Update password when before Open script is finished” on the Before open section.

I know I can update the password in the session if I run PowerShell code from the dropdown list, But I have a PowerShell script with 150 lines that I want on over 10 000 entry’s and that is not a god option.

Password entry is "Find by name(User Vault)" inherited from folder.
Running:
Windows 11
Enterprise Edition 2022.3.23.0
data source: Microsoft Azure SQL
forum image

All Comments (6)

avatar

Hello,

Thank you for submitting this scenario.

When we use a Macro/Script/tool, as you mentioned, it modifies the entry in the data source but not in the current session that is running.

A solution would be to use the PowerShell Script option in the Before Open Event that calls your 150 lines script using Import-Module like this.

forum image

And to update multiple entries to use this solution, you can update the Before Open properties in a PowerShell script for those multiple entries. These are the properties you need to update.

$session.Events.BeforeConnectionEvent = "PowerShell"
$session.Events.BeforeConnectionEmbeddedPowerShellScript = "Import-Module 'c:\temp\yourscript.ps1' 
# call the function of your script here
 YourFunction 
# update the session's password
$connection.password =  new password 
$RDM.Save();"


Let me know if that helps.

Best regards,

Érica Poirier

avatar

Is it possible to switch to PowerShell 7

avatar

Hello,

Yes it's possible in RDM to switch to PowerShell 7.

Head over File - Options - Types - Others to set the PowerShell version parameter to PowerShell 7.

forum image

Best regards,

Érica Poirier

avatar

Nice
Do you know if there a group policy setting to set this?

Did not see it in https://kb.devolutions.net/rdm_group_policies.html

avatar

Hello,

Sadly no but I have submitted a ticket to our engineering team to add it to the policies. Once an update will be available, we will post it here.

Thank you for your patience.

Best regards,

Érica Poirier

avatar

Hello,

We've added a GPO for setting the PowerShell Version. This should be available for the 2023 version. When setting this policy (Name: DefaultPowerShellVersion), the number set in the Policy will reflect the number order set in the actual options, with 0 meaning that the Policy is disabled.

Essentially:
0 = GPO disabled
1 = Default
2 = Windows PowerShell (2.0)
3 = Windows PowerShell (5.1)
4 = PowerShell 7

Regards,

Jafran Majeau