Managed Machines - Enrollment Date

New Contributor

Hi - I was looking to compile a report that detailed the number of machines added to our JSS over time. I thought it might be interesting to trend/track how many machines were added per month/year, etc. Is there a particular data point that details when the JSS QuickAdd was executed / machine joined the JSS, that could be referenced in an extension attribute?

Thanks for any help.


Legendary Contributor III

I think this was discussed in another thread somewhere. I recall participating in it.

Not sure yet about Casper Suite 9 as we're still looking at it, but I know with the 8.x series there was no "enrollment date" you could easily pull. However, you can get the creation date for items like the package receipts that are dropped on the Mac at the time of enrollment.

For example, give this a try:


EnrollDate=$( mdls -name kMDItemFSCreationDate /Library/Application Support/JAMF/Receipts/QuickAdd.pkg | awk '{if ($3 != "(null)") print $3,$4}' )
if [[ ! -z "$EnrollDate" ]]; then
    echo "<result>$EnrollDate>/result>"
    echo "N/A"

The above uses mdls, part of Spotlight, to pull the metadata field for Creation Date on the QuickAdd package receipt. Keep in mind, it may not end up being accurate if you have policies that re-enroll Macs by pushing a QuickAdd.pkg to them, just as an example. It will get updated each time with a new creation date, subsequently changing the date pulled into the Extension Attribute.

You might want to poke around on an enrolled system and look at different files that get created at enrollment to see what's the most accurate for you. Just change the above path to point to whatever you want.

You can look at full metadata for any file using this syntax in Terminal:

mdls /path/to/file/folder

Edit: Forgot to mention that the above script pulls a date format something like:
2013-05-01 13:48:19

So its ideal for a "Date" formatted Extension Attribute. You can then build reports on within x days or before/after a certain date in time for example.

Hope that helps.

Edit 2: I just poked through the Implemented Feature Requests and found this for Casper Suite 9, so looks like an EA won't be necessary for this going forward. I confirmed the criteria is there, selectable in an Advanced Search.