Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.
Endpoint Management Community Blog

Mac OS X Reboot Deferral

Created: 16 May 2011 • Updated: 16 May 2011 • 1 comment
Andrew Bosch's picture
+2 2 Votes
Login to vote

Using CMS 7.x to install software updates on the Mac works quite well.  Before installing updates there is a built-in mechanism with Task Server to notify the end user.  Once updates have installed, the Mac will automatically restart as the system is left in an unstable state.  I have been asked by users how they can insert one last dialog box to warn users that a restart is about to occur and possibly allow them to defer it just long enough to save work, etc.  Using Applescript, here is a sample script that can be incorporated into the patch workflow.  I would recommend you copy and paste the script into AppleScript Editor to make sure it compiles and runs.  Sometimes copy and paste will introduce errors.  Then, create a new Run Script task and select Applescript.  Then, copy and post the working code and Save.  Then, insert the script as part of the patching process, and viola!  you have your very own patch reboot deferral!



tell application "System Events" to display dialog "A restart is required to finish installing new software.

Please select Postpone to be prompted again in 1 minute or OK to restart now." buttons {"Postpone", "OK"} default button 1 giving up after 3600 with icon 0

if button returned of result = "OK" then

return 0

else if button returned of result = "Postpone" then


delay 60 #re-prompt user to restart every 60 seconds

end try

end if

end repeat 

Comments 1 CommentJump to latest comment

donparfet's picture

I attempted to add this script in Symantec Management Console 7.1.8280. I created a new script, selected Applescript as the script type in Jobs/Tasks to test and applied to a Mac running OS 10.7.3. The script runs fine from withing Applescript editor on the local machine, but running as a script from Jobs/Tasks the script fails with an error in the client task history:

Execution result: 1, Script failed by exitingwith a non-zero return code

I am sure I am missing something. Any suggestions would be helpful!

Login to vote