Thursday, May 23, 2013

How To Restart Computers Remotely via PowerShell



You can use the below cmdlet to restart your own computer :
PS C:\> Restart-Computer

To restart a remote computer remotely.
PS C:\> Restart-Computer Server01 -whatif
What if: Performing operation "Restart-Computer" on Target " (Server01)".
The -WhatIf parameter is used to verify the command.

You can use the below commands to reboot multiple computers.
PS C:\> restart-computer "server01","server02","server03" -whatif
PS C:\> restart-computer (get-content c:\work\computers.txt)

You can use below command to pass the credentials
PS C:\> restart-computer (get-content c:\work\computers.txt) -credential "mycompany\administrator"

The Restart-Computer cmdlet will fail, if a logon session is detected.Use the -force parameter to force a reboot. 

6 comments:

  1. Helpful site, able to understand of different parameters to reboot servers.

    A Blog for Fix your computer problems

    ReplyDelete
  2. Thanks for the good writeup. It if truth be told used to be a leisure account it. Look advanced to far added agreeable from you! By the way, how could we communicate? https://adamfantacy.tumblr.com/

    ReplyDelete
  3. Hello just wanted to give you a brief heads up and let you know a few of the images aren’t loading correctly. I’m not sure why but I think its a linking issue. I’ve tried it in two different internet browsers and both show the same results. My Blog http://xerobuff.weebly.com/

    ReplyDelete
  4. This is my first time I have visited here. I found a lot of interesting information in your blog. I guess I am not the only one who noticed this! keep up the impressive work. :p My Blog http://cillerflix.wikidot.com/

    ReplyDelete
  5. You can find no government costs or exchange expenses for trading on the forex areas. My Blog http://www.naseeb.com/b-detail.php?i=279183&s=1&err=Y

    ReplyDelete