Using Powershell to update existing vault settings

Using Powershell to update existing vault settings

avatar

I am trying to update settings on existing vaults, specifically the VPN/Tunnel/Gateway settings and can't seem to find the right command to use. Once I am able to update the vault, I will then want to update the folders and sub-folders settings as well, so the vault settings for VPN will be inherited. What are the proper powershell commands to use for this?

All Comments (3)

avatar

Hello Larry.

Thank you for contacting the Devolutions support team.

You can use this script to change all the entries and folders in this vault to inherited.

$ds = Get-RDMDataSource | Where-Object {$_.Name -eq "<your data source name>"}
Set-RDMCurrentDataSource $ds


$vault = Get-RDMVault | Where-Object {$_.Name -eq "your vault name"}
Set-RDMCurrentRepository $vault


$sessions = Get-RDMSession


foreach ($session in $sessions){
    $session.VPN.Mode = "AlwaysConnect"
    $session.VPN.application = "Inherited"
    Set-RDMSession $session
}


Update-RDMUI


Best regards

Patrick Ouimet

avatar

Unfortunately, I left out some information:

  1. Running Devolutions Server
  2. There are 13 vaults
  3. Vault settings need to be updated first with the proper VPN/Tunnel/Gateway settings
  4. All of the RDP/SSH connections in each vault need to be updated AFTER the vault setting are updated
avatar

Hello Larry,

In this case, I suggest doing some reverse engineering to determine the value of your VPN configuration.

You can set one VPN on the root folder, and in Powershell, you can run:

$RootFolder = Get-RDMRootSession
$RootFolder.VPN


When you have all the needed information, you can run:

$vaults = Get-RDMVault


ForEach ($vault in $vaults){
    $rootFolder = Get-RDMRootSession
    $rootFolder.VPN.Mode = "<your value>"
    $rootFolder.VPN.application = "<your value>"
    ETC...
    Set-RDMRootSession $rootFolder
  }
  
  Update-RDMUI


Then, change all the sessions in all the vaults using the same method as mentioned in my first post, but for all the vaults using the ForEach ($vault in $vaults){}

Best regards,

Patrick Ouimet