Jump to content
LabTechRob

How to: Provide a reboot nag message

Recommended Posts

It's sometimes hard to make sure all computers within an environment are rebooted. Unless you're willing to forgo permission and just bounce them all, how to absolutely ensure a proper reboot has taken place across the board? Simple, use the enclosed 'Prompt for Reboot' script on a location, group or client and within a time, you'll know they will all have been rebooted.

 

We start out with a message "The IT company needs to reboot. May we do this now?" with a yes/no prompt. A 'yes' response results in a bounce. A 'no' response queues the script to rerun in minutes. As the script variables carry over to the new script (well, the same script but that doesn't matter here), the re-run script knows the user has already said no once and prompts appropriately.

 

The user will have the opportunity to say no three times before the hammer comes down. I believe this would be an acceptable reboot process in most environments.

 

If you notice in the description, I twice referred to the times as variable. What provides for the variability? To answer that, you'll need to import the enclosed script, open it in editor and hit the 'Globals and Parameters' tab. There you'll see a variable (lengthOfDelay) set to = 1. Look thru the script - see the references to @lengthOfDelay@? That number is passed to your script so you can delay and display the proper time that's set.

 

1 is chosen by default so you can test this script in your own environment for proper flow and functionality. I imagine when used in production, you'll want to assign a time of 10 or even 15 minutes. To make the change, simply set the 'lengthOfDay' global variable to = your time. That will take care of both the delay and the popup text.

 

There's one change I'd do on this script before running in production. Set line one to: Exit Script and execute only OS = Windows Server. Unless of course, you want some random chaos in your day. ;)

 

 

Happy LabScripting!

Prompt for reboot.zip

Share this post


Link to post
Share on other sites

This sounds great! I just downloaded it and will definitely being trying it out. We have way too many users/computers that skirt the current reboot prompts so I'm eager to see if we can use this idea to fix the problem. Thank you! :)

Share this post


Link to post
Share on other sites

You can use a dataview to validate reboot compliance. Select dataviews -> Assets -> WorkStations. Use the context menu to remove any unnecessary columns, then add 'Agent Uptime'. Next, make sure it is doing a refresh every 30 seconds. Finally, do a 'Save As' and call it 'Agent Uptime'.

 

Now, when you run that command against a Client, Location or Group, you can run the 'Agent Uptime' dataview and get near instant feedback when you've reset your environment.

 

I'm interested to know how that script works for you. As I'm sure you already know, sometimes there's a big difference between making automations work in your test environment vs. the real world! So if there's anything you see that would make that script work better for you and your users, please be sure to let me know.

Share this post


Link to post
Share on other sites

This is SO close to perfect for me.

One problem: The "If User Reponse" action works like the "Ask then Allow" behavior. Is there a script action that works like "Ask then Deny?"

 

We're using the "Ask then Deny" patch reboot behavior and I'd like to implement this script to then re-prompt users a few times before we forcibly reboot them. This script works great if the user actively clicks NO. But if they don't click anything, then this scripts forces the reboot which isn't the behavior I'm hoping to achieve.

 

Any pointers?

Share this post


Link to post
Share on other sites
On 5/15/2013 at 12:29 PM, LabTechRob said:

It's sometimes hard to make sure all computers within an environment are rebooted. Unless you're willing to forgo permission and just bounce them all, how to absolutely ensure a proper reboot has taken place across the board? Simple, use the enclosed 'Prompt for Reboot' script on a location, group or client and within a time, you'll know they will all have been rebooted.

 

We start out with a message "The IT company needs to reboot. May we do this now?" with a yes/no prompt. A 'yes' response results in a bounce. A 'no' response queues the script to rerun in minutes. As the script variables carry over to the new script (well, the same script but that doesn't matter here), the re-run script knows the user has already said no once and prompts appropriately.

 

The user will have the opportunity to say no three times before the hammer comes down. I believe this would be an acceptable reboot process in most environments.

 

If you notice in the description, I twice referred to the times as variable. What provides for the variability? To answer that, you'll need to import the enclosed script, open it in editor and hit the 'Globals and Parameters' tab. There you'll see a variable (lengthOfDelay) set to = 1. Look thru the script - see the references to @lengthOfDelay@? That number is passed to your script so you can delay and display the proper time that's set.

 

1 is chosen by default so you can test this script in your own environment for proper flow and functionality. I imagine when used in production, you'll want to assign a time of 10 or even 15 minutes. To make the change, simply set the 'lengthOfDay' global variable to = your time. That will take care of both the delay and the popup text.

 

There's one change I'd do on this script before running in production. Set line one to: Exit Script and execute only OS = Windows Server. Unless of course, you want some random chaos in your day. ;)

 

 

Happy LabScripting!

Prompt for reboot.zipUnavailable

Any update on the attachment being unavailable for download?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...