Skip to main content

Controlling a Windows 10 PC through SSH

Controlling a remote PC using the AV&CS(SSH) driver

Documentation updated 01.01.2024

Installing OpenSSH on Windows 10​

  1. Click the Start button and select "Параметры" (settings), or press Win + I.

OpenSSH_01.png

2.In the settings window, select "Приложения" (applications).

OpenSSH_02.png

  1. Under "Приложения и возможности" (applications and features), select "Дополнительные компоненты" (optional components).

OpenSSH_03.png

  1. Check for the "Клиент OpenSSH" (OpenSSH client)

In the search field, enter OpenSSH.

If "Клиент OpenSSH" (OpenSSH client) is already installed, proceed to Configuring SSH on Windows 10.

If the component is not installed, continue with the instructions below to install it using PowerShell.

OpenSSH_04.png

  1. Start PowerShell as an administrator:

Open the Start menu.

Right-click Windows PowerShell and select "Запуск от имени администратора" (run as administrator).

OpenSSH_05.png

  1. Confirm that the program can run

An administrator permission prompt appears. Click "Да" (yes) to continue.

OpenSSH_06.png

  1. Check for the OpenSSH component using a cmdlet
  • In PowerShell, enter the following command:

Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'

OpenSSH_07.png

  • After the command runs, information about the OpenSSH components available for installation appears.
  1. Install the OpenSSH component
  • To install "Клиент OpenSSH" (OpenSSH client), enter the following command:

Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0

  • After installation, a status message appears. If RestartNeeded is True, restart the computer for the changes to take effect.

OpenSSH_08.png

Configuring SSH on the central PC​

Configuring OpenSSH on Windows 10​

1.Start Windows PowerShell

  • Click the Start button and enter Windows PowerShell in the search field.
  • Click Windows PowerShell to start it.

OpenSSH_09.png

  1. Enter a cmdlet to check SSH
  • In the PowerShell window, enter:

ssh

  • The output displays help information about the available SSH commands.

OpenSSH_10.png

  1. To connect to a remote server using SSH, run:

ssh username@host

  • username is the username used to connect to the server.
  • host is the remote server's name or IP address.

Example of connecting to Reg.ru hosting: ssh u1234567@123.123.123.123

Configuring control through iRidi Studio​

  1. Add the AV Custom SSH driver to the Panel Project
  • Open iRidi Studio and load your Panel Project.
  • Open the Devices section, or the equivalent section in your project.
  • Add the new AV Custom SSH driver to the list of available drivers.
  • Make sure that the driver has been added and appears in the project.

OpenSSH_11.png

  1. Configure the AV Custom SSH driver

OpenSSH_12.png

  • In the AV Custom SSH driver settings, enter central PC's IP address. This must be the IP address of the device to be controlled over SSH.
  • Specify the Windows user's login and password configured for OpenSSH access on the target PC. These credentials are required to connect and execute commands.
  • Check that the settings are correct and test the connection to verify access.

Controlling Windows applications​

Starting an application​

To start GUI applications and emulate keypresses, you can use Task Scheduler. This lets you create a task that starts an application on request.

  1. Open Task Scheduler .
  2. Create a new task with the required settings (for example, configure a trigger and an action to start the application).
  3. In the Actions section, specify the command to start the application:

schtasks /run /tn "YourTaskName"

where "YourTaskName" is the name of the task you created in Task Scheduler .

This command runs the specified task, which contains the application to start.

Minimizing an application​

You can use Task Scheduler together with AutoHotkey to minimize GUI applications.

AutoHotkey is an input automation tool that can emulate keypresses to control applications.

  1. Install AutoHotkey and create a script to minimize the application (for example, using a command that emulates keypresses).
  2. In Task Scheduler, create a task that runs this AutoHotkey script.
  3. In the Actions section, specify the command to run the task:

schtasks /run /tn "Expand_Calculator"

where "Expand_Calculator" is the name of the task that minimizes the application.

  1. To minimize the application in AutoHotkey, you can use the Collapse_Calculator.ahk script (an example is attached to this document)

Restoring an application​

Task Scheduler and AutoHotkey are also used to restore minimized GUI applications.

  1. In Task Scheduler, create a task to restore the application.
  2. In the Actions section, specify the command to run the task: schtasks /run /tn "Collapse_Calculator" where "Collapse_Calculator" is the name of the task that restores the application.
  3. To restore the application in AutoHotkey, you can use the Expand_Calculator.ahk script (an example is attached to this document)

This script restores the minimized application to its original state.

Closing an application​

To close applications, you can use the Taskkill command, which terminates processes by name.

  1. To terminate a specific application, use:

taskkill /IM "название_программы.exe" /F where "название_программы.exe" is the name of the application's executable file, for example, "advanced_ip_scanner.exe".

This command terminates the application process forcibly using the /F option.

Example command to close Advanced IP Scanner :

taskkill /IM "advanced_ip_scanner.exe" /F

Controlling media keys​

Media keys are controlled using Task Scheduler.

  1. Create tasks in Task Scheduler
  • Open Task Scheduler.
  • Create a new task.
  • In the General tab:
    • Enter a descriptive task name (for example, Start_Pause ).
    • Select "Run with highest privileges".
  1. Create a PowerShell script
  • Create the PowerShell script media-control.ps1 and add the following code:

# Готовый код приложен к документу

Save the script in a convenient location, for example:

C:\Scripts\Start_Pause.ps1

  1. Configure the trigger
  • Open the Triggers tab.
  • Create a new trigger with the required start condition (for example, a button press).
  1. Configure the actions
  • Open the Actions tab.
  • Create a new "Start a program" action.
  • Under "Program/script", specify the path to PowerShell:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Under "Add arguments (optional)", add the arguments:

-WindowStyle Hidden -ExecutionPolicy Bypass -File "C:\Scripts\Start_Pause.ps1"

  1. Assign the commands to a button

After creating the task, configure the button assignment to run the command.

Controlling Wake-on-LAN (WoL)​

  1. Check for WoL support

Before configuring Wake-on-LAN, make sure that the target PC supports it. Detailed instructions for checking are available here: Wake-on-LAN (WoL): how to turn on a computer remotely .

  1. Configure the Wake-on-LAN driver in i3Pro

To configure the Wake-on-LAN driver for i3Pro, follow the official instructions: iRidi for Wake-on-LAN.

Controlling PC shutdown settings​

PC shutdown and restart commands​

  1. Create a "Shutdown PC" command in the AV Custom Systems (SSH) driver. Set the Command parameter to one of the following codes:
shutdown /s - выключение ПК 
shutdown /r - перезагрузка ПК
shutdown /a - отмена выключения или перезагрузки
  1. Assign command execution to a button.

Signing out the active user through Task Scheduler​

Create the PowerShell script Logout_User.ps1 and add:

shutdown /l

  1. Open Task Scheduler and create a new task.

  2. In the General tab:

  • Enter a descriptive task name (for example, User Logout ).
  • Select "Run with highest privileges".
  1. On the Triggers tab, create a standard trigger.

  2. On the Actions tab, add a new "Start a program" action:

  3. Under "Program/script", specify the path to PowerShell:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

  1. Under "Add arguments (optional)", specify the arguments:

-WindowStyle Hidden -ExecutionPolicy Bypass -File "C:\Scripts\Logout_User.ps1"

  1. Assign command execution to a button.

Test scripts​

The attached test scripts automate tasks using Task Scheduler.

For the scripts to work correctly, extract them to:

C:\Scripts

Option 1: Run a PowerShell script through Task Scheduler​

  1. Create tasks in Task Scheduler
  • Open Task Scheduler.
  • Create a new task.
  • Open the General tab:
    • Enter a descriptive task name (for example, Start_Pause ).
    • Select "Run with highest privileges".
  1. Create a PowerShell script
  • Create the file Start_Pause.ps1 and add the code:

# Готовый код приложен к документу

  • Save the script in:

C:\Scripts\Start_Pause.ps1

  1. Configure the trigger
  • Open the Triggers tab.
  • Create a new trigger with a start condition (for example, a button press).
  1. Configure the actions
  • Open the Actions tab.
  • Create a new "Start a program" action.
  • Under "Program/script", specify the path to PowerShell:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

  • Under "Add arguments (optional)", add the parameters:

-WindowStyle Hidden -ExecutionPolicy Bypass -File "C:\Scripts\Start_Pause.ps1"

Option 2: Run an AutoHotkey script through Task Scheduler​

  1. Create tasks in Task Scheduler
  • Open Task Scheduler.
  • Create a new task.
  • Open the General tab:
    • Enter a descriptive task name (for example, Start_Pause ).
    • Select "Run with highest privileges".
  1. Create a script using AutoHotkey
  • Install AutoHotkey on the controlled PC.
  • Create the file media-control.ahk and add the code:

# Готовый код приложен к документу

  • Save the script in:

C:\Scripts\Start_Pause.ahk

  1. Configure the trigger
  • Open the Triggers tab.
  • Create a new trigger with a start condition (for example, a button press).
  1. Configure the actions
  • Open the Actions tab.
  • Create a new "Start a program" action.
  • In "Program/script", specify the path to AutoHotkey:

C:\Program Files\AutoHotkey\v2\AutoHotkey.exe

  • In "Add arguments (optional)", add the parameters:

"C:\Scripts\Start_Pause.ahk"

List of attached scripts for controlling Windows through SSH and I3Pro​

This set of scripts performs various actions on a remote Windows computer using SSH and I3Pro.

🔹 PowerShell scripts:

  • Logout_User.ps1 - ends the user session (signs out).
  • Start_Pause.ps1 - controls media playback (start/pause).
  • Mute.ps1 - turns audio on or off.
  • NextTrack.ps1 - skips to the next track.
  • PreviousTrack.ps1 - skips to the previous track.
  • VolumeDown.ps1 - decreases the volume.
  • VolumeUp.ps1 - increases the volume.
  • Collapse everything.ps1 - minimizes all windows.

🔹 AutoHotkey scripts:

  • Expand_Calculator.ahk - restores the Calculator.
  • Collapse_Calculator.ahk - minimizes the Calculator.
  • Expand_Advanced_ip_scanner.ahk - restores Advanced IP Scanner.
  • Collapse_Advanced_ip_scanner.ahk - minimizes Advanced IP Scanner.