PowerShell: Create SSH session

avatar

Hi

I'm trying to create a bunch of SSH Shell sessions via PowerShell using the following script below (In it's basic form).

I would also like to change the port from 22 (default) to a different port, how would I go about doing this.


#Connect to Devolutions RDM data source
$ds = Get-RDMDataSource -Name "Local Data Source"
Set-RDMCurrentDataSource -DataSource $ds

$session = New-RDMSession -Group "BeyondTrust\PROD\"-Host "*Hostname" -Type "SSHShell" -Name "*Servername";
Set-RDMSession -Session $session -Refresh;

All Comments (1)

avatar

Hello,

The property to modify the default port is the following one.

$session.Terminal.HostPort = 2222


To find what are the properties you want to modify with PowerShell, please see the last section Edit (Special Actions) of the following article.
https://kb.devolutions.net/batch_edit_rdm.html?q=clipboard+powershell#edit-(special-actions)

Let us know if that helps.

Best regards,

Érica Poirier