Solved

Using PSshutdown to Shutdown multiple Compuers at once...

Posted on 2009-05-16
4
1,639 Views
Last Modified: 2013-11-10
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
Comment
Question by:Atomicsteaks
  • 2
4 Comments
 
LVL 69

Expert Comment

by:Qlemo
ID: 24402342
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
 
LVL 84

Accepted Solution

by:
oBdA earned 500 total points
ID: 24402345
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
 

Author Closing Comment

by:Atomicsteaks
ID: 31582194
Thx
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 24497011
Did you use the for approach?
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This is about my first experience with programming Arduino.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question