Skip to main content
Jamf Nation, hosted by Jamf, is the largest Apple IT management community in the world. Dialog with your fellow IT professionals, gain insight about Apple device deployments, share best practices and bounce ideas off each other. Join the conversation.

Imaging Log including Configuration Name

I cam here to ask for this and did a search and found that Larkin asked for it on the old mailing list a few years ago as well.

Can we get the configuration name in the Imaging Log?

I imaged two machines last night and put post-its on them for student and teacher. There are unexpected variations and I wanted to see which particular student and teacher configs I used for each so I went to the imaging log to try and find out but it does not have that info. and I didn't update the autorun data. :(

Order by:

Posted: by jarednichols

About the only thing you could do in the meantime is to lay down a dummy package that contains your configuration name in a place that Casper will pick it up. Then you've got that info and can scope smart groups to it as well.


Posted: by sns

This would be nice. I need one as well. That would be convenient. I was hoping to use a script and just echo the configuration name into a file. I just needed to know the variable that holds the configuration name if any. I guess there's no such variable based on jarednichols answer on both posts.


Posted: by ctangora

Any luck finding the variable to use for the configuration name?


Posted: by mm2270

I'm not using Casper Imaging currently, but from what I can tell, it looks like Casper Imaging only reads data directly from the database when it loads up and doesn't really store any information locally when its launched. I would think it has some plist files somewhere but the only thing I've ever been able to detect is a plist written to in the root account that just stores a few items like the position of the window, nothing at all on the config chosen. Meh.

I think the best you could do is put a script together that uses a Casper Suite script parameter that you fill in at the time you add it and set it up in the Configuration that would get used when it echoes or writes into a file on the target system. That way a single script could get used for any configs and you could even have it "echo" the config name into the imaging log, I think, so hopefully it would appear in there. Not certain about that last bit, but in the very least you could build an EA to capture it to so you'd always know.


Posted: by quedayone

This is the script I am using:


#### Creates a plist for imaging date and configuration used. So we can use the info in the JSS
#### modified from
#### Will Pierce
#### 130225

#Get the date and set it to variable the_date
the_date=`date "+%Y-%m-%d"`

# Configuration=Replace with the name of the config you are placing this script in

# Create the plist
/usr/bin/defaults write /Library/Preferences/ ImageBuildDate "$the_date" 
/usr/bin/defaults write /Library/Preferences/ Configuration "$Configuration"

exit 0

I add this to my Creative configuration at reboot.
Then I have a Extension Attribute "Imaged Date" with:


the_date=`defaults read /Library/Preferences/ ImageBuildDate`
if [ $? -eq 0 ]; then
   echo "<result>$the_date</result>"
   echo "<result>Not Available</result>"

And Extension Attribute "Imaged with Config" with:


Configuration=`defaults read /Library/Preferences/ Configuration`
if [ $? -eq 0 ]; then
   echo "<result>$Configuration</result>"
   echo "<result>Not Available</result>"

It is working well for me eh!



Posted: by thoule

Casper Imaging really needs better logging. It should include
- Username who imaged the machine
- Packages installed (including OS name/version)
- Configuration name
- Scripts run
- Dates all this stuff happened
- NOT have old stuff in log. Why does a newly images machine have a log with stuff from months ago in it?

This was initially requested 7 years ago and it's important!


Posted: by allanp81

I'm using the following which logs to a local text file with the image date and workflow applied and also emails a noticeboard with the same info. I then add a script with the workflow name onto each workflow. I can then query this when applying by just simply checking the contents of the local text file. It works well enough for what I tend to do.

I wondered about maybe just creating a blank .app file in the /Applications directory as Casper would then include this in inventory information so smart groups could be created. I'm going to experiment with this.

#Logs which imaging workflow was run

#make sure log directory exists
if [ ! -d "/Library/Application Support/KingstonUniversity" ]; then
  mkdir "/Library/Application Support/KingstonUniversity/"

#set log file location to log outcome of operation
logfile="/Library/Application Support/KingstonUniversity/kuworkflow.log"

#get the date and time
        while IFS= read -r line; do
            echo "$(date) $line"

#print workflow name based on script name
printf '%s\n' "${0##*/}" | cut -f 1 -d '.' |addDate >> "$logfile"

workflow=$( printf '%s\n' "${0##*/}" | cut -f 1 -d '.' )

echo $workflow

#Check that the smtp server is being specified in /etc/postfix/
if grep 'our.mail.server' /etc/postfix/
        echo "SMTP server already configured"
        echo "SMTP server not configured, adding now"
        echo "relayhost = our.mail.server" >> /etc/postfix/

echo "Emailing ServiceDesk"
sendmail -f noticeboard@kingston<<EOF
Subject: Casper (Service Orchestration) Audit Information
Machine $HOSTNAME imaged with $workflow workflow