Config Server Firewall

How to Shutdown/Restart Remote Computer from CMD

shutdown remote computer cmd

In Windows, we use the shutdown command to power off or reboot the local computer from the command prompt. The shutdown command also has an option to specify a remote computer name.

shutdown /m \\Computer-Name /s

However, most of the time, the command fails to shut down remote computers due to permission issues. Even if it works, it will only work on your local network. You can't use the shutdown command over the internet.

Shutdown Remote PC Over SSH

If you need to shut down/restart your home or work PC over the internet, the best solution is to use SSH.

However, you must first install SSH Server on the remote computer.

How to Install OpenSSH Server on Windows 10/Server

After that, you can use the ssh command on CMD to connect to the remote computer.

ssh ipaddress -l username

For example, the following command connects a computer with an IP address of 192.168.1.100, using the username administrator:

ssh 192.168.1.100 -l administrator

After you are connected, you can run the shutdown command to power off or restart Windows. For example, the following command shutdown the computer after 60 seconds:

shutdown /s /t 60

The following command restarts the computer after 60 seconds:

shutdown /r /t 60

You can stop the shutdown or restart with the /a switch:

shutdown /a

Type shutdown /? to see all available command options.