Home > Casper, CasperCheck, Jamf Pro, Scripting > Identifying the Jamf Pro server set in CasperCheck using an Extension Attribute

Identifying the Jamf Pro server set in CasperCheck using an Extension Attribute

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:

  1. Test VM is enrolled in the test Jamf Pro server
  2. CasperCheck runs on its pre-set schedule and detects that it is not enrolled with the Jamf Pro server specified in the script.
  3. CasperCheck runs its repair functions and enrolls the test VM in the production server.
  4. I wonder why my test VM isn’t talking to the test Jamf Pro server.
  5. 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.
  6. 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.

Casper Extension Attribute Setup

The Extension Attribute is available below. It is also available from GitHub at the following address:

https://github.com/rtrouton/rtrouton_scripts/tree/master/rtrouton_scripts/Casper_Extension_Attributes/CasperCheck/caspercheck_assigned_jamf_pro_server

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: