As part of my Jamf Pro testing process, I will often set up a VM using a production setup workflow then enroll that newly-setup VM into my test Jamf Pro server. However, as part of my production workflow setup, I will usually install my CasperCheck self-repair solution in order to make sure the machine stays enrolled with my Jamf Pro server.
Unfortunately, this can lead to the following chain of events:
- Test VM is enrolled in the test Jamf Pro server
- CasperCheck runs on its pre-set schedule and detects that it is not enrolled with the Jamf Pro server specified in the script.
- CasperCheck runs its repair functions and enrolls the test VM in the production server.
- I wonder why my test VM isn’t talking to the test Jamf Pro server.
- I check the CasperCheck log, grumble when I notice that CasperCheck has done its job, and then install the test server’s CasperCheck script on the test VM.
- Reboot the test VM to trigger the test server’s CasperCheck script to enroll the test VM into the test server again.
This situation happened infrequently enough in the past that I usually just dealt with it on an individual basis, but I finally decided to fix it by writing a Jamf Pro Extension Attribute to help me identify which Jamf Pro server was specified in the installed copy of CasperCheck . For more details, see below the jump.
The Jamf Pro Extension Attribute needs to have the file path to the CasperCheck LaunchDaemon defined. Once this is done, the Extension Attribute is designed to do the following:
If the defined LaunchDaemon is not installed, script returns the following:
CasperCheck Not Installed
2. If the defined LaunchDaemon is installed but the script is unable to determine the address of the Jamf Pro server, script returns the following:
CasperCheck not configured with Jamf Pro server address
3. If the defined LaunchDaemon is installed and the script is able to determine the address of the Jamf Pro server, the script returns the address of the Jamf Pro server defined in the CasperCheck script. This will be displayed in a similar way to the example shown below:
jamf-pro.domain.com
Please see below for how the Extension Attribute should be configured.
The Extension Attribute is available below. It is also available from GitHub at the following address: