/build/static/layout/Breadcrumb_cap_w.png

PSEXEX tool

How can I get this script to work any ideas?
It comes back with a error code -1.....

@ECHO OFF 
psexex @list.txt -u xxxx -p xxxx -c -f shutdown -r -f -t 300 -c "System will reboot in 5 minutes." > Results.log

2 Comments   [ + ] Show comments
  • @ECHO OFF
    psShutdown @list.txt -u admin34321 -p Cm0spr1m3 -r -f -t 300 -c "System will reboot in 5 minutes." >

    Results.log - stevobasquez 8 years ago
  • @ECHO OFF
    psShutdown @list.txt -u admin34321 -p Cm0spr1m3 -r -f -t 300 -m "System will reboot in 5 minutes." >

    Results.log - stevobasquez 8 years ago

Answers (3)

Posted by: anonymous_9363 8 years ago
Red Belt
0
Search for 'shutdown.hta' and then PSExec that. I seem to remember someone posted a version with a countdown...
Posted by: dunnpy 8 years ago
Red Belt
0
I think some of your command line options are off.
Are you really copying (-c) and copying if already exists (-f) shutdown to the remote system?

See here for usage reference.

What about using PsShutdown instead?

Dunnpy
Posted by: stevobasquez 8 years ago
Senior White Belt
0
@ECHO OFF 
psShutdown @list.txt -u admin34321 -p Cm0spr1m3 -r -f -t 300 -m "System will reboot in 5 minutes." > 

Results.log

It restarted the device but for some reason the message isnt appearing what am I doing wrong?


Comments:
  • Message is not displayed because psShutdown sends the message to the session ID 0. Since WIndows VIsta session 0 has been reserved for the system services and as psTools works as a service it is isolated from the user's graphical interface (in general services can't display any messages in the user's environment).
    You can read something more here:
    http://blogs.technet.com/b/askperf/archive/2007/04/27/application-compatibility-session-0-isolation.aspx
    You could try to find the user's session ID and then use psexec -i [session_ID_number] <<Shutdown command>> - rad33k 8 years ago
    • True, a work around can be to send a popup message to everyone on the machine. - dedenker 8 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ