/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


PSEXEX tool

09/25/2015 2307 views
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

All 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

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

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.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
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