We have a Windows server with Devolutions Server installed and also Desktop Manager.
We have a remote Linux server with Powershell Core 7.2
So we have 1 vault/data source for the whole company.
This contains all RDM connections and secrets stored, items are filtered via access rights.
We want to create and update entries in the vault/ds that all users of Dektop Manager will see if they have the proper rights.
What we would like to have some advice on which Powershell module to use.
We can see both modules "Devolutions.PowerShell" and "Devolutions.Server"
Which one would suit our needs the best, given that we have access to the Server and certainly will and can execute scripts on there but we also want to be able to do all the same actions from that remote Linux server.
Please note that accessing the URL/server from that remote Linux server will not be an issue, we can communicate between them.
We have this as a tryout atm but we think we are not on the right path:
Import-Module -Name Devolutions.PowerShell
$RDM_URL = 'https://domain/dvls'
$RDM_AppId = 'xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
$RDM_AppSecret = 'our_very_long_app_secret'
[securestring]$RDM_AppPassword = ConvertTo-SecureString $RDM_AppSecret -AsPlainText -Force
[pscredential]$RDM_Credential = New-Object System.Management.Automation.PSCredential ($RDM_AppId, $RDM_AppPassword)
$Result = New-DSSession -Credential $RDM_Credential -BaseURI $RDM_URL -AsApplication -Verbose
VERBOSE: [Login] Beginning...
VERBOSE: [New-DSSession] Server version: 2023.2.4.0
VERBOSE: [New-DSSession] Authenticating as xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
VERBOSE: [New-DSSession] Completed successfully.
Result is:
DetailedErrorMessage ErrorMessage IsSuccess Result
-------------------- ------------ --------- ------
True Success
When we then try this command:
Get-RDMCurrentDataSource
We get a popup browser to authenticate. Once I have done that, we get some info from that command.
But we got a session started and OK authenticated already with "New-DSSession".
Safe to say, we are confused and think we are mix-matching items and are not handling this properly, hence the ask for advice on which module to use and which commandlets to use. We see mixes og "Verb-DSxxxxx" and "Verb-RDMxxxxx" cmdlets, is this right?
Thanks and regards,
Steven Spierenburg
Hello,
Thank you for contacting us on that matter.
Not so long ago, we had 3 different PowerShell module, one for RDM, one for Hub and one for DVLS. All 3 modules have been merged together to offer only one PowerShell module to interact with our products.
In fact, the way you connect on your DVLS instance using the New-DSSession cmdlet would mean that your script must use only the cmdlets that respect the Verb-DSxxxx format.
It is also possible to use the other cmdlets. The following article also explains how to connect to a DVLS data source using the Verb-RDMxxxx cmdlets.
https://docs.devolutions.net/kb/devolutions-powershell/devolutions-server/powershell-connectivity/
Let us know if you have further questions about this.
Best regards,
Érica Poirier
Hi Erica,
Thanks for your answer and explanation!
Is there a help guide for the cmdlets/functions, where they are all described, parameters explained and examples listed?
I tried the cmdlet "Get-RDMDataSource" and as long as you have RDM installed locally that will get information. However, I want to make sure I am 'talking' to the Devolutions Server, meaning that all actions I want to achieve need to end up in the right place, i.e. the backend (server).
The goal is to make changes to DVLS for all users to see, not just locally where I execute the commands to work with RDM.
So perhaps there is a way to make sure I authenticate/session and execute cmdlets that adhere to the session to DVLS? Or perhaps my understanding on how this works is wrong?
Edit:
Today we tried the following code, something that got us the Vaults at lest but as of today we get different results. DVLS was updated last week, so the Server version is now "2023.2.4.0"
Our Powershell module "Devolutions.Powershell is version "2023.2.0.2"
Import-Module -Name Devolutions.PowerShell
$RDM_URL = 'https://xxx.xxxxxxx.xxx/dvls'
$RDM_AppId = 'xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
$RDM_AppSecret = 'very_secret_code'
[securestring]$RDM_AppPassword = ConvertTo-SecureString $RDM_AppSecret -AsPlainText -Force
[pscredential]$RDM_Credential = New-Object System.Management.Automation.PSCredential ($RDM_AppId, $RDM_AppPassword)
$Result = New-DSSession -Credential $RDM_Credential -BaseURI $RDM_URL -AsApplication -Verbose
VERBOSE: [Login] Beginning...
VERBOSE: [New-DSSession] Server version: 2023.2.4.0
VERBOSE: [New-DSSession] Authenticating as xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
VERBOSE: [New-DSSession] Completed successfully.
$Result
DetailedErrorMessage ErrorMessage IsSuccess Result
-------------------- ------------ --------- ------
True Success
Get-DSVaults
Get-DSVault: Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'Devolutions.Server.ApiWrapper.Paging.PagedResult`1[Devolutions.RemoteDesktopManager.Business.Entities.RepositoryEntity]' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.
To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.
Path 'data', line 1, position 25.
Any idea what might be happening here?
PS: I will include my colleague Michael Weishaar, by sending him to this forum thread, as I will be on holiday next week and he can follow up and communicate further should that be needed.
Regards,
Steven
Hello Steven,
Thank you for your feedback.
Other than what you can get with Get-Help, there is no online documentation available about the most recent version of the Devolutions.PowerShell module cmdlets. You can still refer to this GitHub repository for some instructions about the cmdlets. Please note that the module on this GitHub repository supports DVLS up to version 2022.3.13.
About the Get-RDMDataSource cmdlet and all other Verb-RDMxxxx cmdlets, it's possible to have only one data source created that is bound to your DVLS so you can be sure that there are no other data sources involved. And no need to have RDM installed to use these cmdlets, the Devolutions.PowerShell module is sufficient.
For the error you get, is the Application Key has required access on vaults? You must also set the proper permissions on the vault's root folder to grant access and get results.
Let us know if that helps.
Best regards,
Érica Poirier
Hi Erica,
Thanks for the explanation about the help files.
So what you are saying is that the module we use is not compatible with DVLS? If that is the case, what would be the best approach? We cannot downgrade DVLS. We could install a specific version of the module if there is one?
Regarding the Verb-RDMxxx cmdlets, we already have a central data storage with DVLS, I hope that by going through the RDM cmdlets we can connect with that datasource and work on/in it? Just as if we used the DS cmdlets?
The error is coming from what worked before, I assume an update/upgrade of DVLS will not alter or change the service account we created? Or the rights it has? Everything was set before the update/upgrade hence I assumed this would still work the same.
Regards,
Steven
Hi Steven,
The Devolutions.PowerShell module and its Verb-DSxxxx are totally compatible with DVLS version 2023.2.4 you are using. These cmdlets come from the merge of older module we can find on GitHub and the RemoteDesktopManage PowerShell module. One thing we must keep in mind is that we cannot combine Verb-DSxxxx and Verb-RDMxxxx. They are not using the same communication channel. Sorry about the confusion.
Using the Verb-RDMxxxx cmdlets will allow you to interact with the DVLS data source without any issue.
Usually, you should be able to run the same script without any issue after an upgrade or maybe by doing minor modifications of your script. If you want, we can have a look on your issue in a support session. Then, please open a case by sending an email at service@devolutions.net with a reference to this forum's thread.
Best regards,
Érica Poirier
Hi Erica,
Thanks for the message. I will be on a holiday for 3 weeks so either I need to come back to this thread later or my collegue will continue this discussion.
Thanks for the offer to have a support session should we need it. If that is the case I will get in touch with our team managing RDM/DVLS and get he license information so we can have a proper ticket started for that.
Regards,
Steven