copy template vnc session and ssh tunnel, change linked tunnel in session and destination ip in tunnel
Hello,
I am currently trying to write a PowerShell script, and since my problem is quite specific, I decided to open a new topic.
The goal is to obtain a PowerShell script that is called with an IP address as a parameter.
With this new IP address, the script should clone a template for an SSH tunnel and a template for a VNC session.
In the tunnel, the new IP address becomes the destination IP address for the connection; in the VNC session, the new tunnel must be set up as the session connection.
After changing these values, the session should be started.
Changing the destination IP address in the tunnel has already been successfully achieved with the following lines.
$tunnel =Get-RDMSession -Name $tunnelname
$pf = $tunnel.Terminal.PortForwards[0]
$pf.Destination = $newIP
$tunnel.Terminal.PortForwards[0]=$pf
Set-RDMSession -Session $tunnel
I am currently struggling with the following issues:
I have a workaround for the last question, as I can retrieve the session ID and data source ID from the objects and then use the cmd call but i would be rather happy with a direct powershell launch.
I used the search function but couldn't find any topics that resembled my questions.
Kind Regards
Felix
Hello Felix,
Thank you for reaching out to the Devolutions support team.
Everything that you mention could be done in RDM with a host entry.
You only have to set your tunnel as a child entry and use the variable $PARENT_HOST$.
By doing so, you can use all your templates on the same host.
For your questions regarding PowerShell:
Best regards,
Patrick Ouimet
Hi Patrick
I managed to write a script which does all the what i needed.
just the open-rdmsession does not seem to work at all and i can't figure out why.
when executing the command with the id as paramter and verbose i get the following output and Nothing happens
Open-RDMSession -ID 61f525dc-2b3d-48db-885d-e35514448701
VERBOSE: [Open-RDMSession] Start
VERBOSE: [Open-RDMSession] Finish
the finish is immediate after the start
Hello Felix,
Thank you for this feedback.
Could you tell us which version of RDM you are using?
Which data source type are you using?
Additionally, which version of the module is currently installed?
Best regards,
Patrick Ouimet
Hi Patrick,
RDM Version 2025.2.30.0
local datasource
module version 2025.2.6
I made some research and found a Post which said that the launch of a session only works with the embedded powershell of rdm, is that correct?
or should open-rdmsession also work from an "external" Powershell?
thanks in advance
felix
Hello Felix,
Thank you for this feedback.
An RDM session should open in RDM with the cmdlet Open-RDMSession.
It is working inside and outside of RDM using PowerShell.
Which session exactly are you trying to open with this command?
Is it the SSH session or the tunnel?
Have you tried to open other sessions to see if this is related to session type or to your configuration?
Best regards,
Patrick Ouimet