Shut down and restart Windows with PowerShell commands

We have already reported several times in the past about the various options for shutting down or restarting Windows by command or also time-controlled . Today we want to show you how you can do it very easily and quickly via Windows PowerShell . All you have to do is open Windows PowerShell and this must be done with administrator rights.

Simply enter “PowerShell” in Cortana in the search field and then right- click on ” Windows PowerShell ” and confirm “Run as administrator “.

Then Windows PowerShell appears with the appropriate rights.

Now you can with the command

Restart computer COMPUTERNAME

restart your PC very easily, as you can see below. You only have to replace the placeholder ” computer name” with the name of your computer or you use the name ” localhost ” for your own PC.

If you want to restart several PCs at once, you can simply append the entire computer name to the command with a comma, for example

Restart computer COMPUTERNAME1, COMPUTERNAME2, COMPUTERNAME3  

It is important that you of course have the appropriate access rights so that you also have the right to restart the remote PC. You can do this either by running PowerShell as an ” other user ” who also has the rights to restart. This is usually the case in network domains . You can also enter the user data for the remote login via a corresponding parameter .

Restart computer COMPUTERNAME -Credential DOMÄNE USERNAME

After this command, another window appears in which you must then enter the login data for the remote PC so that you also have the right to restart the PC.

The PowerShell command ” Restart Computer ” has many other parameters, which we do not want to go into in detail here. Microsoft has published a comprehensive overview of all parameters in its article on the PowerShell restart computer command .

Shut down PC instead of restart

If you are now wondering how you can shutdown the PC via PowerShell without restarting it, this is very easy. You just have to go through the ” Restart Computer ” command

Stop computer COMPUTERNAME

replace, as you can see here below.

If you want to shutdown several PCs at the same time, this also works here by separating the computer names with a comma. All parameters of the commands ” Restart Computer ” and ” Shutdown Computer ” are absolutely identical.

If you are interested in other interesting PowerShell commands , just have a look at the following articles.

– Repair Windows component store with DISM and PowerShell commands
– Switch off UAC (user account control ) via PowerShell or registry in Windows 10
– Find out the Windows product key using DOS command or PowerShell

Query Windows Firewall, switch it on and off using PowerShell command – Event log Quickly delete entries with Powershell
– query PowerShell version
– PowerShell – list, stop and start services
– work with restore points in PowerShell

administrator