Collecting Unlock App Usage using a Jamf Pro Extension Attribute

You can create a computer extension attribute in Jamf Pro to monitor which computers have users that are using the Jamf Unlock app for authentication.

This extension attribute uses the UnlockInUse key from the com.jamf.connect.state preference domain to populate inventory information in Jamf Pro.

In Jamf Pro, navigate to Settings > Computer Management > Extension Attributes and create a new computer extension attribute that uses the following script:


#Get current signed in user
currentUser=$(ls -l /dev/console | awk '/ / { print $3 }')

#com.jamf.connect.state.plist location

 UnlockInUse=$(/usr/libexec/PlistBuddy -c "Print :UnlockInUse" $jamfConnectStateLocation || echo "Does not exist")
echo "UnlockInUse"
echo "<result>$UnlockInUse</result>"