Skip to main content
Question

Find machines with no enrollment date

  • February 12, 2026
  • 2 replies
  • 0 views

smurf
Forum|alt.badge.img+1

When creating a smartgroup, there’s a criteria for Last Enrollment. But it’s based on the enrollment date, which does not always have a value. Those machines seem to be excluded from any search which uses the enrollment date criteria. How do you search for machines with no enrollment date?

2 replies

h1431532403240
Forum|alt.badge.img+6

Create a script-based Extension Attribute that checks whether the computer has an enrollment date and returns a simple string value. Then use that Extension Attribute as your Smart Group criteria.

 

Example Extension Attribute (Data Type: String):

#!/bin/bash
enrollDate=$(jamf api GET /v1/computers-inventory-detail/$(jamf api GET /v1/computers-inventory?filter=udid==$(system_profiler SPHardwareDataType | awk '/UUID/{print $3}') 2>/dev/null | plutil -extract results.0.id raw - 2>/dev/null) 2>/dev/null | plutil -extract general.lastEnrolledDate raw - 2>/dev/null)

if [ -z "$enrollDate" ] || [ "$enrollDate" = "" ]; then
echo "<result>No Enrollment Date</result>"
else
echo "<result>Has Enrollment Date</result>"
fi

 

However, a simpler and more reliable approach is to use the Jamf Pro API to query this directly:

# Get all computers and filter for blank enrollment dates
curl -s -X GET "https://yourserver.jamfcloud.com/api/v1/computers-inventory?section=GENERAL&page-size=100" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Accept: application/json" | \
python3 -c "
import json, sys
data = json.load(sys.stdin)
for c in data.get('results', []):
enrollment = c.get('general', {}).get('lastEnrolledDate')
if not enrollment:
print(f\"ID: {c['id']}, Name: {c.get('general',{}).get('name','N/A')}\")"

 

Reference: Smart Groups - Jamf Pro Documentation | Computer Extension Attributes


sdagley
Forum|alt.badge.img+25
  • Jamf Heroes
  • February 13, 2026

@h1431532403240 I think your AI agent of choice is hallucinating because the jamf binary does not have an api verb that allows you to call the API like you’re doing in your first script snippet.