Home » PowerShell » PowerShell: Using Restart-Computer to restart your Computer and Remote Computers

PowerShell: Using Restart-Computer to restart your Computer and Remote Computers

For restarting your computer,  you can simply click the Start Button and afterwards On/Off. In this article it’s all about Windows PowerShell, so we focus on two commands: Restart-Computer and Stop-Computer.

Restart-Computer (Local Host)

If you want to restart your computer by using PowerShell, then Restart-Computer is your friend. The command does what it promises: Restarting your computer. Please don’t do it yet, I want you to keep on reading my article. Believe me: It will become interesting.


I have a solution for the problem mentioned before. Run Restart-Computer with the parameter WhatIf. The system then only tells you what would happen, if …

Restart-Computer -WhatIf


Or use the parameter Confirm. It’s your choice to press Y or N. 😉


To delay the restart use Start-Sleep. By the way: The Force parameter restarts the Computer even when users are logged on.

Start-Sleep -Seconds 10 ; Restart-Computer -Force


Restart-Computer (Remote Host)

For restarting a remote computer use -ComputerName. Make sure both hosts share the same Active Directory Domain.

Restart-Computer -ComputerName client001 -Force


Restart-Computer (Multiple Hosts)

If it’s the goal to restart all domain-computers (except servers!), run

(Get-ADComputer -Filter 'operatingsystem -notlike "*server*"').Name | Restart-Computer -Force -ErrorAction silentlycontinue


More about this topic see my article Restart all Domain Computers by using PowerShell.


All of the examples above work with Stop-Computer, as well.


Have fun playing with Restart and Stop-Computer!

See also

For more remoting action see also

Active Directory: Send Messages to all currently logged on Users (msg.exe)

Microsoft Docs



1 Comment

  1. […] PowerShell: Using Restart-Computer to restart your Computer and Remote Computers […]


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s



My name is Patrick Grünauer (pewa2303). I am from Austria. On sid-500 I write about Windows, Cisco and IT-Security in English and German. Have fun while reading!

Patrick Gruenauer
Follow SID-500 on