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

Comments

  • @ECHO OFF
    psShutdown @list.txt -u admin34321 -p Cm0spr1m3 -r -f -t 300 -c "System will reboot in 5 minutes." >

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

    Results.log
Please log in to comment

Answers

0
Search for 'shutdown.hta' and then PSExec that. I seem to remember someone posted a version with a countdown...
Answered 09/30/2015 by: VBScab
Red Belt

Please log in to comment
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
Answered 09/25/2015 by: dunnpy
Red Belt

Please log in to comment
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?

Answered 09/25/2015 by: stevobasquez
Senior White Belt

  • 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>>
    • True, a work around can be to send a popup message to everyone on the machine.
Please log in to comment
Answer this question or Comment on this question for clarity