Get Passwords via RDM-Powershell from Lastpass

Get Passwords via RDM-Powershell from Lastpass

avatar

Hello

We love the new RDM Powershell Integration. We have all our passwords stored in Lastpass and use them in RDM.

When we use the Get-RDMSessionPassword we get the password when it's in the RDM database, when it's in Lastpass we get just an empty string back.

Is there a way to get the correct password from Lastpass back? Because like that we can't really use this Powershell command.

Best regards.
Patrick

All Comments (13)

avatar

Is this a bug?

avatar

Hi Patrick,

A fix has been made in Get-RDMSessionPassword for the LastPass credentials.

It's already available in Remote Desktop Manager 12.0.3.0 (Beta)



To get the password from your LastPass credentials, you get your session and use Get-RDMSessionPassword:
$session = Get-RDMSession -Name LastPass
Get-RDMSessionPassword -Session $session

Best regards,

Olivier Désalliers

avatar

Thanks a lot!

avatar

Hi Olivier

I just tried with 12.0.3.0 Beta.
PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> Get-RDMSessionPassword -Session (Get-RDMSession -Name "Testconnection with password in DB")
testpassword
PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> Get-RDMSessionPassword -Session (Get-RDMSession -Name "Testconnection with password in Lastpass")

PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager>
I still get back null / empty string for a Session that gets the credentials from the lastpass repository.

Using your example

PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> Get-RDMSessionPassword -Session (Get-RDMSession -Name "Lastpass")opens a GUI-Window with all our saved LastPass Credentials to choose from. Is this expected?

Best regards,
Patrick

avatar

Hi Patrick,

Does your LastPass session use the Integrated or Credential redirection?

If you try to copy the password in RDM with the UI. Can you do it and does it work?

For the popup, I suppose the session named LastPass is of type LastPass credentials. Did you check "Always prompt with list" in it?

Best regards,

Olivier Désalliers

avatar

Hi Olivier

Our LastPass Session is set to "Integrated". Copying the Password to Clipboard via UI is working fine.

The Checkbox "Always prompt with list" is indeed set, as we have saved a lot of our Credentials in LastPass. Creating an additional LastPass Credential entry for every Connection would result in quite a lot of overhead which we want to avoid.

Best regards,
Patrick

avatar

Hi Patrick,

I'm not able to reproduce the issue but I've made another fix regarding credentials resolving with PowerShell. It does not target LastPass credentials directly but all the credentials types so it might fix it.

It will be available in a future release of RDM. I will repost when the version will be available.

Sorry for the inconvenience.

Best regards,

Olivier Désalliers

avatar

Hi Oliver

Should it Be working in the newest Version?

Best regards.
Patrick

avatar

Hi Patrick,

Can you try with Remote Desktop Manager Beta (12.0.7.0)? The fix I wrote about in my last post is in it.

Best regards,

Olivier Désalliers

avatar

Hi Olivier

It works in Beta 12.0.7.0, thank you.

One more question: How can I change the active data source? I tried example 2 at https://help.remotedesktopmanager.com/get-rdmdatasource.htm but the Set-RDMDataSource Cmdlet seems to expect an object of type BaseConnectionDataSource, which I don't know how to generate. Get-RDMDatasource returns a PSDataSource object.

PS C:\Users\administrator\Desktop> $list = Get-RDMDataSource; Set-RDMDataSource $list[1].ID
Set-RDMDataSource : Cannot bind parameter 'DataSource'. Cannot convert the "14ab67f3-2792-4dd9-9a9d-8b0410e31899"
value of type "System.Guid" to type "Devolutions.RemoteDesktopManager.Business.DataSources.BaseConnectionDataSource".
At line:1 char:46
+ $list = Get-RDMDataSource; Set-RDMDataSource $list[1].ID
+ ~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (: ) [Set-RDMDataSource], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,RemoteDesktopManager.PowerShellModule.SetRDMDatasourceCommand

PS C:\Users\administrator\Desktop> $datasource = Get-RDMDataSource -Name cxsql3
PS C:\Users\administrator\Desktop> Set-RDMDataSource $datasource
Set-RDMDataSource : Cannot bind parameter 'DataSource'. Cannot convert the
"RemoteDesktopManager.PowerShellModule.PSOutputObject.PSDataSource" value of type
"RemoteDesktopManager.PowerShellModule.PSOutputObject.PSDataSource" to type
"Devolutions.RemoteDesktopManager.Business.DataSources.BaseConnectionDataSource".
At line:1 char:19
+ Set-RDMDataSource $datasource
+ ~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (: ) [Set-RDMDataSource], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,RemoteDesktopManager.PowerShellModule.SetRDMDatasourceCommand
Best regards,
Patrick

avatar

Hi Patrick,

You need to use Set-RDMCurrentDataSource to change the active data source.

Ex:
$list = Get-RDMDataSource
Set-RDMCurrentDataSource $list[1].ID
Best regards,

Olivier Désalliers

avatar

Hi Olivier

Thanks, it seems I accidently used the wrong Cmdlet.

I just noticed that Get-RDMSessionUserName does not work when the credentials are stored in lastpass, similar to the initial issue with Get-RDMSessionPassword.

PS C:\Users\administrator> Get-RDMSessionUserName -Session (Get-RDMSession -Name "Testconnection with password in DB")
testusername
PS C:\Users\administrator> Get-RDMSessionUserName -Session (Get-RDMSession -Name "Testconnection with password in Lastpass")

PS C:\Users\administrator>
Best regards,
Patrick

avatar

Hi Patrick,

A potential fix for your issue has been made for credentials resolving with Get-RDMSessionUsername.

It should be available in the next version.

Sorry for the inconvenience.

Best regards,

Olivier Désalliers