How to remotely shut down or restart your Windows 10 computer

First steps to turn off or restart your computer over the network

To perform this process correctly, you must be connected to the same local area network (LAN) as the computer you want to shut down or restart.

In addition, you need to know the username and password assigned on the computer (if installed). Without this information the process will not be possible.

Before you take any action, make sure that TCP port 445 is open in Windows Firewall on the computer you want to shutdown or restart.

To do this, go to “Control Panel” and “Security Center”. Then select the Windows Firewall option.

Go to the Exceptions tab. Typically, the option to allow file and printer sharing is already selected.

Today, many antiviruses take over the firewall function, then you need to look into them.

If it's not, select it and click OK. If you don't see the File and Printer Access line, click Add Port and select 445 TCP.

Then open Control Panel again. Select "System" and "Allow users to connect to this computer" on the "Remote" tab.

Remote computer reboot

As I said earlier, PowerShell is an excellent tool for remotely managing computers, servers and services. Let's assume that I have an RDS farm consisting of 10 servers running Windows Server 2020. I need to perform maintenance on four servers, for this I put them in Drain Mode to cut off new connections, and send a notification to employees via msg so that employees logged out. After I start servicing the system data, when I finish, I need to reboot them. To do this, we will use the following construction:

Restart-Computer -ComputerName w10-cl02, w10-cl03 (w10-cl02, w10-cl03 names of remote computers or servers)

After executing the command, the computer reboots; if this does not happen, you will most likely receive an error:

Restart-Computer: Failed to restart computer w10-cl02 with the following error message: The system cannot be initiated because the computer is in use by other users. line:1 character:1 + Restart-Computer -ComputerName w10-cl02, w10-cl03 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (w10-cl02:String) [Restart-Computer], InvalidOperationException + FullyQualifiedErrorId : RestartcomputerFailed,Microsoft.PowerShell.Commands.RestartComputerCommand Restart-Computer: Failed to restart computer w10-cl03 with the following error message: The system cannot be initiated because the computer is in use by other users. line:1 character:1 + Restart-Computer -ComputerName w10-cl02, w10-cl03 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (w10-cl03:String) [Restart-Computer], InvalidOperationException + FullyQualifiedErrorId : RestartcomputerFailed,Microsoft.PowerShell.Commands.RestartComputerCommand

The catch here is that active sessions of working users remain on the computers, namely in interactive mode. In such cases, if they have not logged out and are not responding to your messages, you can force a restart of your computer with a clear conscience. To do this, you can use the -Force switch; as a result, the PowerShell construction will look like this:

Restart-Computer -ComputerName w10-cl02, w10-cl03 -Force

As you can see, the command worked successfully and the computer was rebooted.

If you want to reboot a remote computer as a specific user, then this cmdlet will allow you to do this. To do this, enter:

Restart-Computer -ComputerName w10-cl02, w10-cl03 -Credential root\sem (Where root is the domain name, and sem is the user login)

As a result, you will see a window for entering the user password, enter it and click “Ok”. By the way, if there is an active user session in interactive mode on the remote computer that needs to be rebooted, then you will also get an error that “the computer is being used by other users” and you will need to add the -Force key:

Restart-Computer -ComputerName w10-cl02, w10-cl03 -Credential root\sem -Force

In the Windows logs on those computers, in the system log, you can find an event with code ID 1074 (/kak-uznat-kto-perezagruzil-server-windows/), in which you will see who rebooted the system:

The process C:\Windows\system32\wbem\wmiprvse.exe (W10-CL02) initiated the Restart action for computer W10-CL02 as user ROOT\sem for reason: Reason not listed Reason code: 0x80070015 Shutdown type: Restart

Let's say you have a list of computers that need to be rebooted remotely. In such a situation, God himself ordered the use of PowerShell. The file structure looks very simple, a regular text document in txt format. There is one computer name on each line, no commas. I put it in the root of the C:\ drive.

In order to read this file, there is a Get-Content cmdlet and the command structure takes the following form:

Get-Content -Path C:\computers.txt | Restart-Computer-Force

As a result, the remote reboot of the computer via PowerShell worked successfully and all systems from the file were serviced.

To shut down or restart your computer over the network, use the command - net use

To obtain the necessary rights, you must first use the net use command on the target computer.

Before starting the whole operation, you will also need the address of the destination computer. To enter the NET USE command, launch the command prompt and enter the command below:

  • Net use \\IP of target PC /user:administrator

Then enter the administrator name and password - if the operation was successful, you will see the corresponding information on the screen.

How to find the computer name

Step 1. On the remote PC, press Win+R, type “sysdm.cpl” and click “OK”.

On the remote PC, press Win+R, type “sysdm.cpl” and click “OK”

Step 2. In “System Properties”, click on the “Computer Name” tab and click “Change”.

In “System Properties”, click on the “Computer Name” tab and click “Change”

The PC name will be written in the “Computer name” item. Here you can also view the “Workgroup Name” used to create a shared network.

The PC name is specified in the “Computer name” section

Shut down or restart the computer using the Shutdown command

To restart or shut down your computer using Remote Desktop, you can use the shutdown command via the command line.

After launching Command Prompt, in a black window, type:

  • shutdown /r /f

Next use the command:

  • /r – reboot

Or

  • /f - force restart (ignore interfering processes) of processes

After confirming with Enter, the system will inform you that the computer or laptop will restart in a moment.

If you want to turn off and restart your computer or laptop, if it’s frozen, try using: /f – it might work.

In case of failure, I recommend running Command Term as Administrator, especially if User Account Control is activated.

Reboot via TeamViewer

If you need a comprehensive tool for managing your computer, then TeamViewer is perfect for this role. Download and install it according to our instructions:

  1. Open the link and click on the “Download for free” button.
  1. Open the installer.
  1. On the first screen, click “Accept-Complete”.
  1. After installation, the program will launch automatically. TeamViewer must also be installed on the second computer. On the PC to which you are connecting, you need to look at the ID (1) and enter it in the “Partner ID” field on the control computer (2). After that, click “Connect to partner” (3).

Now you will have access to the desktop of the second device. You will be able to reboot it through the Start menu or Alt+F4.

After rebooting, TeamViewer will require you to log in again, which may not be possible. Therefore, initially you need to enable easy access in the options:

  1. In the TeamViewer window, click on "Advanced" and select "Options".
  1. Open the Security tab. Enter your password twice in the marked fields (1) and check the box next to “Give easy access” (2). After this, click on “Configuration” (3).
  1. In the window that opens, enter the login and password of the account to which you plan to connect without authorization.

Ready! Now, after each reboot, you don’t have to run to a remote computer and enter your account password manually or ask a user located next to the connected PC to do this.

How to restart or shut down a computer via - bat

If you frequently reboot your computer via remote desktop, it's a good idea to create a file (.bat) on your desktop.

To do this, create a “Text Document” (txt) and name it “Restart.bat”. In this case, you must have extensions enabled (otherwise you won’t see anything).

If you don't see the .bat extension, you should go to Folder Options and uncheck o.

Now enter the command in the created file (it is better to do this before renaming it to “Restart.bat”), for example - shutdown /r /f. Then we close, saving the changes and can run the file.

It can be used to automatically restart your computer, for example, every Saturday. Just set it to run at a specific time in the Task Scheduler.

Now you can move on to the main command, thanks to which you can shut down or restart your computer over the network.

For those who are not yet fully familiar with such procedures, here are a few commands for the drive, as an example: shutdown -a -f -t 30 - m \\192.168.3.4/

At this stage, I recommend that you run: shutdown /? – you will be immediately shown all supported commands.

  1. So -a - the Shutdown command can be executed during the Shutdown Delay action.
  2. -f: Forces currently running applications to be shut down without warning.
  3. -t xx: Sets the countdown in seconds.
  4. -m \\ xxx.xxx.xxx.xxx: IP address of the target computer.
  5. Graphics are available after the command: Shutdown -i.

The shutdown command to shutdown, reboot, or hibernate

To shutdown, reboot, or hibernate using the command line, use the shutdown command. Main list of parameters:

  • /? — Display help. Same as without parameters.
  • /i - Display the graphical user interface. This parameter must come first.
  • /l - End the session. This option cannot be used with the /m or /d options.
  • /s - Shut down the computer.
  • /g - Shut down and restart the computer. After the system restarts, launch all registered applications.
  • /a - Cancel system shutdown. This option can only be used during the waiting period.
  • /p - Immediately shutdown the local computer without warning. Can be used with the /d and /f options.
  • /h - Switches the local computer into hibernation mode. Can be used with the /f option.
  • /e - Indicates the reason for the unexpected shutdown of the computer.
  • /m - \computer Specifies the destination computer.
  • /t xxx — Set a delay of xxx seconds before shutting down the computer. Valid range: 0-315360000 (10 years); default value: 30. If the timeout period is greater than 0, the /f option is applied.
  • /c - “comment” A comment with the reason for restarting or shutting down. The longest length is 512 characters.
  • /f - Forces closure of running applications without warning users. The /f option is used when the /t option is set to a value greater than 0.
  • /d xx:yy - You must specify a reason for rebooting or shutting down. "p" means scheduled reboot or shutdown. "u" means the reason is user defined. If neither "p" nor "u" is specified, the reboot or shutdown is unplanned. "xx" is the primary reason number (a positive integer less than 256). "yy" is the reason auxiliary number (a positive integer less than 65536).

If you are interested in the full list of parameters, then run the shutdown

without parameters.

How to turn on or restart your computer using the Wake On Lan command

The Wake On Lan operation involves switching the system over the network by sending a Magic Packet to the network card of the target computer.

Important: Not all network adapters and BIOS are compatible with the Magic Packet tool.

To perform this operation, the device you want to use to perform it must be connected to the same local area network (LAN) as the target one, that is, the one you want to turn on from a distance.

In addition, you must know the physical address (MAC address) and IP address of the destination PC. Without these elements, such an operation cannot be performed.

Remotely reboot your computer via web browser with shutter

Another way to remotely reboot your computer is to install a free application created by Denis Kozlov called Shutter.

It is a remote scheduling tool that gives you access to remote activities and events. For example, you can check CPU usage (action) or trigger a remote shutdown (event). With Shutter installed on your target PC, you can perform various remote functions on your computer through the browser.

Firstly, don't worry about the settings on this screen because they are for using the app locally. However, you are interested in using Shutter as a server that provides remote access to your PC from any browser.

To configure this, click Options > Web Interface. Here, select Enable, select Listen IP from the list and enter any port you want to use. Port 80 is the most common as it is the default. However, if you need extra security, you can use some obscure port.

Finally, set your username and password (required), click Save and the app is ready - it's that easy!

Download: Shutter

Setting the shutter to remotely restart your PC

To use it outside of your home network, you'll need to open a hole to access Shutter through your router.

To do this, open your router's page (usually 192.168.0.1 or 192.168.1.1, depending on the brand of your router) and configure port forwarding. Refer to your router's documentation for the exact steps for your router model.

Just make sure that the IP address and port you defined in Shutter are defined here and enabled. Once saved, the setup is complete. Now you can go to any web browser and send not only the “restart” command to your computer, but also a whole list of other commands.

To access Shutter remotely, open your browser and enter the IP address and port you specified earlier. For example: 192.168.1.103:8080

From an external location, such as a library or work, enter your assigned ISP external IP followed by the port. It could be: 65.xxx.xxx.122:8080. The web interface will appear after logging in with the ID and password you have defined.

Not sure what your external IP is? Just visit whatismyip.com in your browser.

Please note that you will need a static IP address to access Shutter from outside your local network. Here you can perform various remote tasks, from turning off your computer to muting the sound or running a specific program.

To restart Windows remotely using the Shutter web interface, click Restart, then Run. Job is done!

How to turn on a computer remotely using the WOL program

You need to download the Wake-on-LAN (WOL) program. This is what it looks like when you open it

Then fill out the required fields using the information you previously received.

  1. Mac Address: MAC address (target computer)
  2. Internet address: Local IP address (target computer)
  3. Subnet mask: 255.255.255.255
  4. Send Options: Local Subnet
  5. Remote port number: 8900
  6. Click the "Wake Me Up" button.

Remote shutdown of Linux server

Here everything turned out to be much simpler. A working solution was immediately found that allows you to remotely shut down any Linux server without any problems. The problem is solved using standard putty tools. This program can be run from the command line with parameters. As parameters, you can specify a file with commands to execute, server address, user and password.

We will prepare everything you need. First, create a simple text document shutdown.txt

the following content:

Putty.exe -m shutdown.txt -ssh -P 22 -l root -pw rootpass 10.10.5.15

We transfer 3 files to the user, placed in one folder:

  • putty.exe
  • shutdown.txt
  • serv-rem-shut.bat

Now, when you run the serv-rem-shut.bat script, a console command will be sent to the server over the network to shut down. No questions will be asked. The server will simply shut down silently.

How to turn on a computer remotely over a network

Theoretically, after appropriate configuration of the router, you can turn on the computer via the Internet.

More specifically, it is about forwarding a UDP packet from a specific port to all devices connected to the network.

Only in practice does such a device allow such operations (IP address xxx255 for type C networks).

The process is done by sending a Magic Packet to your public IP address and corresponding port (as described above), which will shut down the computer.

One configuration provides access to all devices on a given network, but thanks to the appropriate settings, each of them can operate independently of the others.

Remote control of your computer

The Allow Control panel is used to display information for remote control of your computer. Here you can find information about the ID of this computer in the TeamViewer system, as well as a password that can be changed if necessary.

In the “Personal Password” field, you can enter your password to access a specific computer from anywhere.

You will need to transfer your ID and password to your remote partner, who will remotely control your computer.

After connecting to your computer and entering the data received from you, your remote partner will control your computer.

Rating
( 1 rating, average 4 out of 5 )
Did you like the article? Share with friends:
For any suggestions regarding the site: [email protected]
Для любых предложений по сайту: [email protected]