Help with Import-RDMSessions Command in Devolutions Server

Resolved

Help with Import-RDMSessions Command in Devolutions Server

avatar

Hi all,
We recently installed the Devolutions Server in conjunction with RDM in our company. Creating multiple vaults using PowerShell worked well, and the connection to RDM is also functioning fine. Everything seems to be going smoothly so far.
Now, I want to use PowerShell to set up the same directory structure and sessions across all new vaults. Unfortunately, I'm having trouble with the Import-RDMSessions command. I’m unable to get it to work as expected.
Has anyone here worked with this command before or encountered a similar issue? Any help or guidance would be greatly appreciated.
Thanks in advance!

All Comments (6)

avatar

Hello,

What part of the import isn't working properly?

Which file format are you exporting the entries? It's easier with RDM file format.

You must not use the -KeepID switch with the Import-RDMSession cmdlet as all original sessions and folders will be moved to the destination vault.

Best regards,

Érica Poirier

avatar

Sorry for being so vague. I've created about 200 vaults and I want to import an .rdm file into all of them using PowerShell. A JSON import would also be possible.
I've tested the following code, but I'm not quite sure how the syntax should be correct.

$ds = Get-RDMDataSource -Name "NameDataSource"
Set-RDMCurrentDataSource $ds

$repos = Get-RDMRepository

foreach ($repo in $repos)
{
Set-RDMCurrentRepository $repo
Import-RDMSession ???
}

avatar

Hello,

Thank you for your feedback.

It should be something like this:

Import-RDMSession -Path c:\Temp\MyEntries.rdm -SetSession      


I recommend testing it on one vault first to avoid importing the wrong information into all 200 vaults.

Let us know if that helps.

Best regards,

Érica Poirier

avatar

It worked. Thank you so much for the help. Although it keeps asking for the password for the RDM file in the loop, I can solve that with variables. Thanks again for the suggestion and have a great weekend!

avatar

Here is the full Code:

$ds = Get-RDMDataSource -Name "Devolutions Server"
Set-RDMCurrentDataSource $ds
$passwd = ConvertTo-SecureString -AsPlainText -Force "YourPassword"

$repos = Get-RDMRepository

foreach ($repo in $repos)
>> {
>> Set-RDMCurrentRepository $repo
>> Import-RDMSession -Path c:\TEST.rdm -DuplicateAction Ignore -Password $passwd -SetSession
>> }

avatar

Hello,

Thank you for sharing your code sample with the community.

That's great new that it's now working as expected.

Best regards,

Érica Poirier