

$password – This is the password in plain text of the user you will be using to initiate the ssh connection – (Please note you can modify this to be more secure by using a secure-string and converting it later on, but that is an article for another day) – In the example we will be using $plinkpath – This is the path to the plink.Using NoMachine for remote access to a computer on the local network Install NoMachine on your first computer.

Ideally this is a non root user, but in the example we will use root $username – This is the name of the user you will be using to initiate the SSH connection.This must either be the IP or a DNS-resolvable host name of the server/device for example .x or test-server $servername – This will be the server/device you wish to run the SSH command on.In the example, I will be using df -h to show storage statistics on a machine $command – This will be the command you want to execute on the remote machine.

I will also show you how to do this via a one liner so you don’t have to specify any variables. These can be modified as needed to fit your use case. Chances are if you have puTTY installed you will have a copy of this located in the program files folder for example C:\Program Files (x86)\PuTTY\įor ease of explanation we will be using a few variables. In order to run SSH commands using powershell you will need to have a copy of plink.exe this can be downloaded independently as a binary here. For more details on putty please go to the PuTTY homepage. There are a few methods for doing this however, this article will highlight how to use PuTTY to do this. PuTTY is a tool that can be used to allow an admin to customize and connect to SSH instances. In some circumstances you may wish to run SSH commands using a powershell script.
