PowerShell is an extremely useful tool when it comes to scripting redundant tasks or simply tackling several things at once. This week at work I needed to restart about 140 laptops on our network, and I turned to PowerShell to do it quickly!
The command looks like this:
Restart-Computer -ComputerName COMPUTER -Force -Credential USERNAME
The credential you use needs to have administrative rights on the computer in order for it to work. I also had to use the FQDN of the user account for the username which looked like this: domain.com\username.
You can restart a list of computers by using Restart-Computer in the following way:
Restart-Computer (get-content c:\computers.txt) -Force -Credential USERNAME
Obviously you need to change the C:\computers.txt to a file that actually exists on your computer and the file would consists of one computer name on each line.
That is all there is to it! Comment and share if you found this post to be useful!