Configure Datasource with powershell: hidden ??

Implemented

Configure Datasource with powershell: hidden ??

avatar

Hi,

I trying to full configure RDM with powershell. This is the code to create datasource: (It's a test: I use SQL Express.I use a sql server for production)

$d = New-RDMDataSource -SqlServer -Database "RemoteDesktopManager" -Name "Test" -Server "localhost\SQLEXPRESS" -IntegratedSecurity
Invoke-RDMCreateDataSourceDatabase $d
Set-RDMDataSource $d

1/ there is an error with the database création:

[...]
[22/03/2022 17:16:07]INFO Upgrading database for data source 'Test' with version 749
[22/03/2022 17:16:07]INFO Upgrading database for data source 'Test' with version 750
[22/03/2022 17:16:07]ERROR SILENT System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Management.Automation.PSArgumentException: label cannot be null or empty.
   at System.Management.Automation.Host.ChoiceDescription..ctor(String label)
   at Devolutions.RemoteDesktopManager.Managers.UIManager.ShowYesNoCancelMessage(Image largeImage, String message, String yesText, String noText, String cancelText)
   at Devolutions.RemoteDesktopManager.Business.DataSources.DatabaseConnectionDataSource.ConfigureVersionManagementPrompt(Version minVersion, Version maxVersion)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Devolutions.RemoteDesktopManager.Business.DataSources.DatabaseUpdater.Upgrade(Boolean silent, Action`1 logMessage)


2/ My datasource is hiddent ! When I start RDM, there is only the original local datasource, I can't select my sql datasource. But, with powershell (Get-RDMDatasource), the datasource is return. If I create a new datasource in RDM manually, The Get-RDMDatasource give me 3 datasources, the local, the powershell version and the manually created.

So why, my powershell created datasource is hidden ??

Thanks you

All Comments (4)

avatar

Hello,

What RDM version are you using?

Are you running PowerShell with the same user context as when you run RDM?

Best regards,

Érica Poirier

avatar

2022.1.21.0
Yes. All is done with the local Administrator account

avatar

Hello,

Thank you for your feedback.

About the first problem, could you please try without the IntegratedSecurity switch but use instead the -Username and -Password switches? Please note that you have to convert the password in a secure string.

About the other problem, it seems that the RDM PowerShell module doesn't use the same RemoteDesktopManager.cfg file as the one in RDM.

Are you running RDM or PowerShell as an administrator?

Best regards,

Érica Poirier

avatar

Hi,

Regarding the error while creating the database. I was able to reproduce the issue and a fix will be available in the next release.

Regards

Jonathan Lafontaine