Leverage Software Updates via Casper

Casper can be used for software updates but I felt something was missing (I am talking about me here!), so I went about writing something to help.
I wanted to once a week be able to install os x updates on all my clients and prompt them to restart while giving them a grace period if they couldn’t do it at the time of the prompt.

First, I created a smart group to find all my clients that had an update pending.
Screen Shot 2015-02-13 at 4.18.42 PM
Once I had that setup, the next step was to configure a policy that would take care of the update process but also would incorporate the other pieces I was interested in. I recently learned about JamfHelper, it’s a very neat UI tool to pass info to users but also does support prompt.
To add some fancy to the pot, it also supports icons; I was set to complete this project.
I created a simple package that copies my prepared company logo into /private/tmp/, I wanted to be official!!
You can just use Casper Composer to create the package.
Once that was set, the next phase was to script my scenarios
I needed my GUI to inform my users that were in my smart group upon that their Mac had been updated and we needed them to restart either now or later.
While some updates do not need a restart, I also wanted to tackle the restart your computer so other things can be installed at login or startup and we can crush that huge uptime.
My script is available on my Github
Based on a time in Hours set, my users are prompted about updates having been installed on their macs and we needed them to restart now or later (later been the time set).
Based on the time set, the script will use the sleep command and resume another prompt once the time has passed but this time without the option of later, they will only be able to click now and the message can not be closed.

Screen Shot 2015-02-13 at 4.45.38 PM

Screen Shot 2015-02-13 at 4.46.18 PM

The values to change in the scripts are:
TIME #The Later option in Hours
LOGO #Replace COMPANY.icns by the name of your icns file
TITLE #This is the title of the GUI Prompt
PROMPT_HEADING #The main header within the GUI
PROMPT_MESSAGE #The text you want displayed to the user
PROMPT_MESSAGE_TWO #The second text to be displayed if they chose to reboot later

Once customized, it is time to get the policy going.
We create a policy to install software updates, on recurring but once a week with a client based schedule (This is of my own choice, if you feel you don’t need a schedule, you can skip it)
The policy will contain:
My icns package
Apple software updates
my script set to run after

Make sure the restart option is disabled, it tend to add itself.
The scope will be the smart group we created and Voila………..
Screen Shot 2015-02-13 at 4.56.33 PM

Now all my clients update once a week and other updates I have in the queue to be installed at login or startup also install.
My users expect to only be bugged once a week about update and I know their computers are getting the attention they need.
Everyone is happy……..
——Update————-
I have updated the script to address skipping users who had manually installed their updates after the last inventory update so they are not prompted again.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s