Using PSshutdown to Shutdown multiple Compuers at once...


I have a small bat file that shut's down a single computer using the Psshutdown tool. I would like to use it to shutdown more that one computer....Code is below..
psshutdown.exe \\<computer ip> -t 10  -f -u <username> -p <password>

Open in new window

Who is Participating?
oBdAConnect With a Mentor Commented:
Simply put the names or addresses of those machines into a list and use the (path and) name of this file instead of the machine name, with an @ in front.

Or, if you want to do it all from within the batch file:

psshutdown.exe @"C:\Temp\shutdown.txt" -t 10  -f -u <username> -p <password>
@echo off
set ComputerList= SomeName
for %%a in (%ComputerList%) do psshutdown.exe \\%%a -t 10  -f -u <username> -p <password

Open in new window

QlemoBatchelor and DeveloperCommented:
put the IPs into a file, each address on a separate line, and use
psshutdown @ips.txt -t 10 -f -u username -p password

AtomicsteaksAuthor Commented:
QlemoBatchelor and DeveloperCommented:
Did you use the for approach?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.