PowerShell who to move an entry to a different Vault

PowerShell who to move an entry to a different Vault

avatar

Hi

When the script is in a Vault and I have the Entry ID to an entry in a different Vault, what is the best way to move it to the vault the script is in?

All Comments (6)

avatar

Hello,

Thank you for contacting Devolutions Support.

I just want to confirm I understand fully. You are asking how to copy an entry to another Vault ?

Best regards,

Eric St-Martin

avatar

No, I want to move the entry.

avatar

Hello,
There are 2 ways

  • PowerShell > This creates a copy and deletes the original
$session = Get-RDMSession -Name "Session Name" 
Set-RDMCurrentRepository -Repository (Get-RDMRepository -Name "Destination Vault")
Set-RDMSession -Session $session
Set-RDMCurrentRepository -Repository (Get-RDMRepository -Name "Original Vault")
Remove-RDMSession -Session $session


  • Via RDM > Edit > Move to Vault


Best regards,

Eric St-Martin

avatar

Is there a way to Multi vault search in the PowerShell module? Bases on the session id to find the “Original Vault”?

avatar

Hello,
You could do this with a Foreach statement, small example below

$repo = Get-RDMRepository
 foreach ($repos in $repo) {
   Set-RDMCurrentRepository $repos
    Get-RDMSession | Where-Object { $_.ConnectionType -eq 'RDPConfigured'}
  }


For finding its Original Vault based off the Session ID, you would need to have the ID ahead of time and see if it exists within each Vault.

Best regards,

Eric St-Martin

avatar

Thank you