Kaseya Community

Prompt for Reboot script

  • Hi everyone,

    I've been trying to create a script that check if any user is logged into a workstation, then prompt the user for a reboot and then reboot based on their action.

    I've had a look around for some VBS sample scripts but can't find anything.

    Could anyone help me out?

    Cheers,

    Legacy Forum Name: Prompt for Reboot script,
    Legacy Posted By Username: LANWorx
  • I already posted this one on the forum before, maybe you could find it with a search. But here is the one I use anyway:

    Script Name: Reboot with User Prompt
    Script Description: This script works with Reboot with User Prompt 2 and it will Reboot Computer with User Prompt (Yes/No). If Timeout will prompt user to respond if he is there. If no answer Reboot in 5 minutes, telling user to save everything.

    IF User Response is Yes
    Parameter 1 : Synetek Proactive has updated your PC and needs to be rebooted, Save all your data and click yes to reboot or click no to reboot later.
    Parameter 2 : 3
    THEN
    Write Script Log Entry
    Parameter 1 : Rebooting
    OS Type : 0
    Reboot
    OS Type : 0
    ELSE
    Execute Script
    Parameter 1 : Reboot with User Promt 2 (NOTE: Script reference is NOT imported. Correct manually in script editor.
    Parameter 2 : 4
    Parameter 3 : 1
    OS Type : 0

    *******************************************

    Script Name: Reboot with User Promt 2
    Script Description: This script works with Reboot with User Prompt and it will Reboot Computer with User Prompt (Yes/No). If Timeout will prompt user to respond if he is there. If no answer Reboot in 5 minutes, telling user to save everything.

    IF User Response is Yes
    Parameter 1 : Are You There? If you are not currenty there, the system will restart automatically.
    Parameter 2 : 2
    THEN
    Execute Script
    Parameter 1 : Reboot with User Prompt (NOTE: Script reference is NOT imported. Correct manually in script editor.
    Parameter 2 : 4
    Parameter 3 : 1
    OS Type : 0
    ELSE
    Send Message
    Parameter 1 : Please Save all your Data. Computer Rebooting in 5 minutes.
    Parameter 2 : 1
    OS Type : 0
    Pause Script
    Parameter 1 : 300
    OS Type : 0
    Write Script Log Entry
    Parameter 1 : Timeout Reboot.
    OS Type : 0
    Reboot
    OS Type : 0

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: christian@syneteksolutions.com
  • SP1 for 2008 also includes some sample Reboot with Yes/No prompt scripts.

    Lloyd

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: lwolf
  • lwolf
    SP1 for 2008 also includes some sample Reboot with Yes/No prompt scripts.

    Lloyd


    Sample Scripts > Agent Control

    I think.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: CeruleanBlue
  • Yeah, we just update to SP1, so we've got those now.

    I've also chosen to go with a slightly edited version of Christian's script though, thanks!

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