Solved

Using PSshutdown to Shutdown multiple Compuers at once...

Posted on 2009-05-16
4
1,637 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 83

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

3 Use Cases for Connected Systems

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

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
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 …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

776 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