Skip to content

Microsoft Windows PowerShell – Reboot Multiple Servers

You may use the following Microsoft Windows PowerShell script to reboot multiple Microsoft Windows hosts on a network.

<# .SYNOPSIS This script will query a list of hostnames then reboot each server. .DESCRIPTION This script will query a list of hostnames then reboot each server. .EXAMPLE Restart-Computer $SERVER .AUTHOR Written by Noel Enrique Alvarez on Friday, April 12, 2019. #>

#The file to be queried for the hostnames
$SERVERS = Get-Content “<<<INSERT PATH>>>”

#Reboot each host in the file
ForEach ($SERVER in $SERVERS)
{Restart-Computer $SERVER -Force}

#End of script

Published inAutomationMicrosoft Windows PowerShellScripting

Comments are closed.