• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1662
  • Last Modified:

Using PSshutdown to Shutdown multiple Compuers at once...

Hello,

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

0
Atomicsteaks
Asked:
Atomicsteaks
  • 2
1 Solution
 
QlemoC++ 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

0
 
oBdACommented:
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=1.2.3.4 1.2.3.5 SomeName
for %%a in (%ComputerList%) do psshutdown.exe \\%%a -t 10  -f -u <username> -p <password

Open in new window

0
 
AtomicsteaksAuthor Commented:
Thx
0
 
QlemoC++ DeveloperCommented:
Did you use the for approach?
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now