get-RDMSessionUserName and get-RDMSessionPassword are not returning values
Hello,
I would like to ask you for help with get-RDMSessionUserName and get-RDMSessionPassword.
I have simple script, that is getting username and password from RDM session for connection to device via SSH.
It was working perfectly in legacy powershell module.
But now with new PS module from GitHub (2021.2.0.27) Get-RDMSessionUserName and Get-RDMSessionPassword
are NOT returning any values.
$rdmSession= get-RDMSession | Where-Object { $_.ID -eq $rdmSessionGuid }
$rdmSessionUser= Get-RDMSessionUserName -Session $rdmSession
$rdmSessionPassword= Get-RDMSessionPassword -Session $rdmSession
Thank you for any help.
Best regards,
Ivo
Hello Ivo,
Using the same code as you, I am able to retrieve the username and the password. The only change required was to add -AsPlainText for the password
$rdmSessionPassword= Get-RDMSessionPassword -Session $rdmSession -AsPlainText
Is your variable $rdmSession populated with a session?
What version of RDM are you using and what type of Data Source?
Best regards,
Richard Boisvert
Hello Richard,
yes, $rdmSession is populated.
Actually none of get-RSMSessionUsername or get-RDMSessionPassword are returning any value.
Any idea ?
PS C:\Users\Admin> $rdmSession | fl Name,ConnectionType,CredentialConnectionID Name : AA57 - LAN - Mikrotik RB3011 ConnectionType : AddOn CredentialConnectionID : 19xxxxx5-f768-4408-9a2f-17xxxxxxxx0 PS C:\Users\Admin> Get-RDMSessionUserName -Session $rdmSession PS C:\Users\Admin> Get-RDMSessionPassword -Session $rdmSession -AsPlainText PS C:\Users\Admin>
Thank you,
Best regards,
Ivo
Hello Ivo,
AddOn entries can cause issues with the PowerShell module, it also had problems with the old RDM PS module.
Would it be possible to send me the entry via PM: in RDM, right-click on the entry > Clipboard > Copy - and then paste it in the PM, you can modify any confidential information as needed.
Best regards,
Richard Boisvert
Hello Richard,
I sent you exported RDM Session via Direct Message.
Thank you.
Ivo
Hello,
I have the same behaviour with a "winbox" entry, whether the credential is linked or directly in the entry.
I will raise a ticket with the engineering team and get back to you once I hear back from them.
Best regards,
Richard Boisvert
Hello Richard,
any news on this ?
Thank you.
Regards,
Ivo
Hello Ivo,
The ticket is still pending with the engineering team. They were busy stabilising the PowerShell module, they should be able to process requests, such as yours, in the near future.
Best regards,
Richard Boisvert
Hi Ivo,
The issue with WinBox has been fixed internally and will be available in the next release (2021.2.0.31).
Regards
Jonathan Lafontaine
Hello,
with 2021.2.0.31 it is working with PS5, but in PS7.2 I'm not able to get username nor password.
Thank you.
Regards,
Ivo
Hi,
All my testing were performed with PS7.2 and I was able to retrieve a WinBox username and password.
That would mean something in your setup, that wasn't in mine, doesn't like PS7.2. Now to find what.
What data source is your entry in? Main or private vault?
Jonathan Lafontaine
Hello,
I'm using MS SQL server and it is main vault.
Thank you.
Ivo
In PS7.2, is Get-RDMInstance returning 2021.2.0.31 also?
Jonathan Lafontaine
Hello,
yes it is, please see code below.
PS C:\Users\Admin> Get-RDMInstance
ApplicationVersion OptionFilename
------------------ --------------
2021.2.0.31 C:\Users\Admin\AppData\Local\Devolutions\RemoteDesktopManager\RemoteDesktopManager.cfg
PS C:\Users\Admin> $rdmSession= get-RDMSession | Where-Object { $_.ID -eq "xxxxxx10-cxxx-4xxx-a4xxx-0xxxxxxxxxxx3"}
PS C:\Users\Admin> $rdmSessionUser= Get-RDMSessionUserName -Session $rdmSession
PS C:\Users\Admin> $rdmSessionPassword= Get-RDMSessionPassword -Session $rdmSession -AsPlainText
PS C:\Users\Admin> $rdmSession.Name
[XX] Jxxxxxxx1 - LAN - Mikrotik RB3011
PS C:\Users\Admin> $rdmSessionUser
PS C:\Users\Admin> $rdmSessionPassword
PS C:\Users\Admin>
Thank you.
Ivo.
Same here. Although sometimes I do get a return. Looks like when a credential entry is freshly made, it works most of the time. As soon as you edit it, no more username or password is returned. Same versions with regards to PowerShell and RDM
When you say as soon as you edit it, you mean editing the entry in RDM seems to be breaking the ability to fetch the username/password in PowerShell?
Jonathan Lafontaine
Looks like it...although I haven't been able to reproduce today. Made a fresh credential entry and still didn't get a password (username I get by using the HostUserName property). For now, the only temp solution I have is a custom credential entry. The property (Get-RDMSession -Name <name>).Credentials. CustomScript is readable. Problem is, it's not encrypted but next week I have to start my reporting runs and since all my scripts rely on DPS, I have no other option.... bummer
Cheers,
Peter
Are your entries not working also addons or it's across the board, doesn't matter what kind of entry it is?
Jonathan Lafontaine
Just the default username/password credential entries (New Entry -> Credential Entry -> Username/Password)...I did however also noticed an issue with the GUI (although that might not be related): With the previous version, when I opened a session selecting Open with parameters -. Select Credentials, the credentials were nicely filled in. For some reason it stopped working for some sessions (mainly vCenter entries, Windows looks to work still)...its just weird
Thank you.
That gives me different scenarios to work with to hopefully be able to figure out what the problem is.
Jonathan Lafontaine
Your welcome. If I need to do anything or you want a look at our config (WebEx, Teams, Zoom), feel free to ask
(09:30-18:00 CET...just to be sure :-))