Error attempting to start New-DsSession

Error attempting to start New-DsSession

avatar

Hi,

We're currently exploring the possibilities of the Devolutions.Server PowerShell module and we're encountering the following error:

$Cred = Get-Credetial
New-DSSession -Credential $cred -BaseUri <DLS_URL>
Exception: C:\Program Files\WindowsPowerShell\Modules\Devolutions.Server\2022.2.6.1\Private\OAuth (WIP)\Request-DSOAuthAccessToken.ps1:25
Line |
  25 |              throw 'Error while retreiving tokens.'
     |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Error while retreiving tokens.

<DLS_URL> would of course be our current DVLS server URL. I have verified this variable and I am using the URL we currently use for our RMD client configuration (which does work).

Regarding the credentials, I am using an local admin created within the DB and have confirmed his password using the RDM client.

PowerShell Version : 7.2.6
Devolutions.Server Version : 2022.2.6.1

I'm assuming I'm doing something wrong, but I cannot figure out what.

Best regads,

Alexis De Jaeger

All Comments (5)

avatar

Hello Alexis,

If you are using the same URL as the one in RDM, it should work, but it is returning an error with the OAuth access token.

Could you confirm what version of Devolutions Server you are currently using? If it is an older version, you would need to use an older version of the Devolutions Server module: https://www.powershellgallery.com/packages/Devolutions.server/

Best regards,

Richard Boisvert

avatar

Hi Richard,

Thank you for your reply.

Our server is currently on version : 2022.6.2.0
While the PowerShell module I'm using is on version : 2022.2.6.1

There doesn't seem to be a direct correlation between the module and the server version.
How can I find which module and server version are compatible?

Best regards,

Alexis De Jaeger

avatar

Hello Alexis,

As long as the first 2 sets of digits match, 2022.2 for example, the connection should work. The PowerShell module is released at a slower pace than Devolutions Server, so the versions will never match.

I did a quick test on my end with DVLS 2022.2.9, the PS module version 2022.2.6.1 and a custom user, and it works as expected:
forum image

Can you make sure the URL does not contain a / at the end, as it will create issues.

Best regards,

Richard Boisvert

avatar

Hi Richard,

Thank you for your reply.

I've made some other discoveries while trying to figure this out yetserday:
forum image
For clarification:

  • The first 2 lines are me attempting to reinstall the module, but it no longer seems possible
  • "CredentialManager" is a PowerShell module allowing the access to the Windows credential manager from PowerShell
  • The look of the shell is modified using "OhMyPosh", but it doesn't do anything other than visual changes


I can always manually remove the contents related to the module from : C:\Program Files\WindowsPowerShell\Modules , but I would rather not do so if possible.

Best regards,

Alexis De Jaeger

avatar

Hello Alexis,

If you want to uninstall the module, you can always use Uninstall-module -Force Devolutions.Server

As for using the credential manager, you can use this module if you prefer: https://github.com/Devolutions/SecretManagement.DevolutionsServer , it integrates directly with the Devolutions Server module.

Best regards,

Richard Boisvert