Unable to establish connection to MSSQL datasource from Powershell

Unable to establish connection to MSSQL datasource from Powershell

avatar

I am running RDM v 2022.2.14 and have installed PS module version 2022.3.1.8 9via install-module -Name "RemoteDesktopManager"

I launch RDM and connect via the GUI to my MSSQL data source fine. - We use DB authentication.

However no matter what sequence or permutations I try I cannot get the 'IsConnected' to change from FALSE to TRUE and therefor all commands return the same message "WARNING: Your connection is not ready"

I have tried from both within the GUI (PowerShell RDM CmdLet0 and from a separate powershell session.

However if I set up a local SQL_Lite data source I am able to connect to it and execute RDM PS commands if open the SQL_Lite data source in RDM GUI, select an entry and then launch the CmdLet..

What am I missing??

All Comments (6)

avatar

Hello,

Is there any MFA set on your data source?

Does the following command work?

Set-RDMCurrentDataSource (Get-RDMDataSource -Name "NameofyourSQLdatasource")


Could you please try the Start-RDMInstance cmdlet to see if it will connect?

Best regards,

Érica Poirier

avatar

We are not using 2FA
These are the steps I tried with the last line showing the "WARNING: Your connection is not ready" error

  • Launch RDM
  • From within RDM (2022.2.14.0) GUI
  • Select an Entry in the list of available
  • Tools -> Powershell CmdLet (Module)



Resize PowerShell buffer and window size
Loading RDM CmdLet (Module)

PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> Get-RDMCurrentDatasource

ID          : 672a4cab-XXXX-XXXX-XXXX-efeacc7a1ee6
IsConnected : False
IsOffline   : False
Name        : <my RDM current GUI session data source>
Type        : SQLServer

PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> Set-RDMCurrentDataSource (Get-RDMDataSource -Name "<my RDM current GUI session data source name>")
PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> Start-RDMInstance
PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> Get-RDMCurrentDatasource

ID          : 672a4cab-XXXX-XXXX-XXXX-efeacc7a1ee6
IsConnected : False
IsOffline   : False
Name        : <my RDM current GUI session data source name>
Type        : SQLServer


PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> Get-RDMCommand

C:\Program Files (x86)\Devolutions\Remote Desktop Manager\RemoteDesktopManager64.exe

PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> Get-RDMVersion

2022.2.14.0

PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> Get-InstalledModule -Name "RemoteDesktopManager"

Version    Name                                Repository           Description
-------    ----                                ----------           -----------
2022.3.1.8 RemoteDesktopManager                PSGallery            Devolutions Remote Desktop Manager
(RDM) PowerShell Module

PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> Get-RDMUser -Name "<my account name>"

WARNING: Your connection is not ready

avatar

when I do the following it works fine trying to connect to my local SQL Lite Data Source

PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> Set-RDMCurrentDataSource (Get-RDMDataSource -Name "Local_SQL_Lite")
PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> get-rdmcurrentdatasource


ID : 8bf34a73-XXXX-XXXX-XXXX-63288c58d5eb
IsConnected : True
IsOffline : False
Name : Local_SQL_Lite
Type : SQLite

avatar

Weird behaviour

After the previous connection to SQL Lite data source then within the same PS window going back to the MS SQL entry its now working??
I did notice a brief "upgrading......" status message appearing across the screen ??


PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> Set-RDMCurrentDataSource (Get-RDMDataSource -Name "<MS SQL DATA Source>")
PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> get-rdmcurrentdatasource


ID : 672a4cab-XXXX-XXXX-XXXX-efeacc7a1ee6
IsConnected : True
IsOffline : False
Name : <MS SQL Data Source>
Type : SQLServer

avatar

Now having solved the connection issue (IsConnected shows TRUE) I am unable to retrieve any session information

PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> Get-RDMSession -IncludeSubFolders
Get-RDMSession : Connection not found.
At line:1 char:1
+ Get-RDMSession -IncludeSubFolders
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-RDMSession], Exception
+ FullyQualifiedErrorId : 0,RemoteDesktopManager.PowerShellModule.GetRDMSessionCommand


if I revert to the SQL Lite datasource that command works


Further note: we do have more than one Vault/Repository if that makes any difference

avatar

Hello,

Thank you for your feedback.

I see that you are using RDM 2022.2.14 but the RemoteDesktopMannager PowerShell module 2022.3.1.8. Could you please try to uninstall the module and install version 2022.2.3.0?

Could you please try to create a new SQL data source, do not duplicate the existing SQL data source, and use this one to connect from PowerShell?

Do you get the same behavior outside RDM in a PowerShell command prompt?

Best regards,

Érica Poirier