Kaseya Community

Editing shutdown script for user intervention

  • I would like to edit a shutdown script so that the end user has the option to delay or postpone the script from running, and be prompted again in 20 minutes to postpone the shutdown, if the user does not respond in 5 minutes I would like the script to run.

    Any help would be great....

    Legacy Forum Name: Editing shutdown script for user intervention,
    Legacy Posted By Username: alanwalt@fdlrez.com
  • Here is something that should work as you need.
    Script Name: User prompt shutdown
    Script Description:

    IF User Response is Yes
    Parameter 1 : This system is scheduled to shut down do you wish to delay?
    Parameter 2 : 5
    THEN
    Get Variable
    Parameter 1 : 6
    Parameter 2 :
    Parameter 3 : machineid
    OS Type : 0
    Schedule Script
    Parameter 1 : 22499044
    Parameter 2 : 20
    Parameter 3 : #machineid#
    OS Type : 0
    ELSE
    Execute Shell Command
    Parameter 1 : shutdown.exe /f
    Parameter 2 : 1
    OS Type : 0



    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: RichardB
  • I edited the script just a little bit and it worked great. Thanks again for the fast response, you the man!!

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: alanwalt@fdlrez.com
  • I am trying to do something just like this.

    My question though is:

    If the user postpones the shutdown, but then shuts the computer down manually BEFORE the script runs again, won't it just run next morning when they boot the computer? This is where I keep getting hung up, since there's no skip if online in the schedule script parameter.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: bsrichardson
  • That is where you use "skip if machine is offline" when you schedule the script. It is working fine for us.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: ddenhoed
  • I was trying to have mine set up so if they tried to post-pone it the script would re-schedule. Took me forever to figure that out to avoid the re-scheduling of the script if they manually shut it down before it re-ran. I avoided this by a simple copying of the script multiple times and scheduling every 30 minutes. If they respond yes then do nothing.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: bsrichardson
  • We had problems with re-scheduling the script, and if the user had shut down themselves then next morning when they booted up they would get the same question.

    Our work-around was to copy the shutdown script and scheduling it to run automatically every half hour, skipping offline and if they post-poned it wouldn't do anything, just wait until the next half hour. This has worked 100% for us.

    One other problem we had was there are some machines that need to stay on, so we excluded groups, simple. But a machine here and there, wasn't so easy. So we scheduled a blank empty script on all machines, either do nightly shutdown or don't nightly shutdown, have it run maybe once a month or so..just as long as it's scheduled.
    Then, our view for nightly shutdown computers is all machines with do nightly shutdown scheduled. Viola!

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: bsrichardson