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?
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
Unfortunately, I left out some information:
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