Connect to datasource

Connect to datasource

avatar

Since implementing MFA with Office365 I can no longer connect to powershell with RDMS

forum image

I guess that makes sense, however what's the command to manually connect to a data source with a local DLVS account?

All Comments (12)

avatar

Hello,

You can use an Application Key to connect on your DVLS to run your scripts.

You can create a data source in RDM that is configured with the Application Key and Application Secret set in the PowerShell tab of a DVLS data source.

forum image

Or you can manually create a data source in PowerShell with this sample script. Please replace the variables values with your values.

$dsname = "DVLS PowerShell"
$dsurl = "https://your_dvls_url"
$appkey = "your_appkey"
$appsecret = "your_appsecret"

$ds = New-RDMDataSource -DVLS -Name $dsname -Server $dsurl -SetDatasource -WarningAction SilentlyContinue
Set-RDMDatasourceProperty $ds -Property "ScriptingTenantID" -Value $appkey
Set-RDMDatasourceProperty $ds -Property "ScriptingApplicationPassword" -Value $appsecret
Set-RDMDataSource $ds
Set-RDMCurrentDataSource $ds


Let me know if that helps.

Best regards,

Érica Poirier

avatar

Brilliant - the first option worked well.
Thanks.

avatar

Actually, using an application key I get this error. There doesn't appear to be anywhere in the application to be able to set permissions as an administrator.

forum image\

And all the active directory groups are greyed out and not selectable

forum image

avatar

Hello,

Since those groups are imported from the domain, you cannot assign a user/application to them manually. You would need to create a custom user group that has administrator rights, and then assign the application to it.

Best regards,

Richard Boisvert

avatar

Thanks, that worked!

avatar

This has suddenly broken again

Application shows that login occured a few seconds ago after I launch powershell but it's reporting connection not found?

forum image

forum image


forum image

avatar

Same issue if I use the powershell script Erica posted above

forum image

avatar

Hello,

It is as if your serial was not properly applied to the RDM module. Could you run Get-RDMDiagnostic and make sure it can detect it?

You can force the registration by using these commands, if your RDM license is available in your data source:

$ds = Get-RDMDataSource -Name "your data source"
Register-RDMFromDataSource $ds


Best regards,

Richard Boisvert

avatar

forum image

forum image

avatar

Hello,

Since you do not have that last cmdlet, you are running an older version of the RDM module. Could you first update it to see if it helps:

Update-Module -Name RemoteDesktopManager

If it still fails to connect, it is possible the configuration file that PowerShell is using is different than the one from RDM.

To validate, run the Get-RDMInstance cmdlet and make sure the OptionFile path matches with RDM; you can find that path in File > Options > Advanced (the last line).

If they are different, you can point PowerShell to the right cfg with an override.

$or = Get-RDMPowerShellOverride
$or.OptionFilePath = "same/path/as/rdm/RemoteDesktopManager.cfg"
Set-RDMPowerShellOverride

Restart your PowerShell instance after.

Let us know if it helps!

Best regards,

Richard Boisvert

avatar

Updating the module fixed the problem. Connection now works straight away without needing to do anything.

FYI - Module was on version 2022.2.17.0 which is the version of RDM I'm running.

avatar

Hello,

Glad to hear it fixed the issue!

Please note there is no correlation between the PowerShell module and RDM, they are released on different schedules. Simply make sure the first 2 sets of digits match at a minimum (2022.2.x).

Best regards,

Richard Boisvert