Solved

Using PSshutdown to Shutdown multiple Compuers at once...

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

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 68

Expert Comment

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

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now