Run Policies Immediately After Re-Image with Casper Imaging

Contributor II

I am sure there are several ways to do this, just wondering what some of these Options are

For whatever reason after Casper Imaging image, certain apps will not install, scripts run etc: Java will not install, Sophos will not, sometime AD binding will not execute, search domain scripts, etc. (And, I do not want to ever deal with the Casper Imaging "Curtain" coming down. It takes took long even for 5 KB script and sometimes never goes away, just hangs.)

I have the Policy, and currently it does all I want, but I run it from a Trigger event and then it reboots, wa la, Mac all set for use. How to automate this, right after Casper Imaging, what would be the Policy Trigger, and so it's only scoped to these such Macs. Thx in advance


Honored Contributor II
Honored Contributor II

Hi, there's a trigger to run a policy after enrollment which might suit your needs. If not, you can add a script to casper imaging that runs a policy on a custom trigger. Just use ```
jamf policy -event triggername
``` to get it to run.

If your macs are stalling on the splash screen after imaging there is probably something else wrong. Possibly a post install script running something else, or referencing something that it can't locate.

Release Candidate Programs Tester

@johnklimeck there is an check box titled something like "Install from boot volume at imaging time"

We check that for nearly all PKGs (not needed for all.. But doesn't hurt).

The PKGs are then cached at imaging time on the Mac, imaging then restarts the Mac & auto logs in as an account called "adobeInstall" (legacy name).

Whilst logged in as that account the PKGs are installed & any scripts set to reboot can be run.

We have a "post flight" script that contains a manual trigger for a policy.

That policy then has our AD bindings etc.

I've blogged it in more detail:

New Contributor III

@bentoms We use a very similar imaging workflow. Question though... do scripts set to run at reboot run while the packages are installing or do the scripts wait to run until after all the packages that are set to install after imaging are installed? My fear is that after the computer reboots the script runs, which triggers policies. I don't want these policies running until all the packages are done installing.

Hopefully this question makes sense. :)

Release Candidate Programs Tester

@bgreeno for us the scripts run after packages are installed.

So yea, question made sense. :)