- Create your list of servers in a text file one per line with no extra spaces or characters.
- Run the batch file under an ID with administrative access to the servers.
NOTE: This is the bare script to perform the action. You may want to add logging and error checking to the script. Adjust the shutdown command line meet your requirements.
@echo off
REM --- Parse list of servers
for /f %%a in (path\ServerName.txt) do CALL :RbtMe %%a
goto :DONE
:RbtMe
REM --- Restarting remote system.
shutdown -r -t 05 -c "Rebooting for BLAH" -f -m %1
GOTO :EOF
:DONE
————————————————————————————————————————
See this website for information on remote shutdown/reboots using the Windows shutdown command.
Discuss This Question: