Flush policy logs at reimage to rerun "Once per computer" "startup" scripts?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 05-24-2012 06:52 AM
Is there a way to automatically flush the policy logs after reimaging a machine? I have scripts that are using the "startup" trigger and the "Once per computer" frequency that I would like to have run again once the machine is reimaged.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 05-24-2012 07:02 AM
In post image script put
jamf flushPolicyHistory

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 05-24-2012 09:35 AM
I am assuming that the post image script is just a script that is set to run "After" that I would add to the Configuration? Or is there a script that's already somewhere that I need to edit?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 05-24-2012 09:39 AM
I was under the impression that once a computer had a new OS imaged/installed, regardless of the method (Casper/DVD/etc) it was considered to be a "new" computer, in terms of policy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 05-24-2012 09:43 AM
Script would be at reboot.
@natkins - no policy history isn't wiped at reboot unless you run that command.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 05-24-2012 10:48 AM
CasperSally is correct, any policies that had previously run on it that were set on a "once" type basis will not run again unless you flush the policy history for that system, because Casper Suite uses the MAC address to identify systems. So even if it got a new name, new OS on it, etc, it still sees it as the same Mac that already ran those once per computer policies.
You can also overcome this issue with things like Extension Attributes, Smart Groups and ongoing policies, but unless they are set up that way, flushing the policy history for that Mac is probably your best bet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 05-24-2012 11:09 AM
@natkins - no policy history isn't wiped at reboot unless you run that command.
Right, my mistake. We're using custom triggers that I thought were set to "Once per computer", but were in fact set to Ongoing.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 05-24-2012 02:07 PM
So selecting "At reboot" will run the script at every reboot?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 05-25-2012 06:50 AM
Once, when imaging is done.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 10-09-2013 06:44 AM
I have put jamf flushPolicyHistory in my FirstBoot script (set to run at reboot after imaging), but the policies are not flushing.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 10-09-2013 07:26 AM
You may want to make sure it is the 1st of your scripts running after the reboot, since it goes alphabetically I just added an a to the beginning of the name of my flush policy script.
Gabe Shackney
Princeton Public Schools
Princeton Public Schools
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 10-09-2013 04:47 PM
We have removed the command from our Post Image script as it is part of imaging now.
https://jamfnation.jamfsoftware.com/discussion.html?id=7952
