The scripts in this repo export device information from SimpleMDM, check for macOS updates via the SOFA feed, and generate detailed reports.
- Export full device details to CSV
- Identify devices needing macOS upgrades
- Generate supported macOS versions per device model
- Caching for API responses to reduce redundant calls
- Retry logic for robust API communication
- Bash shell (macOS/Linux)
jqJSON processor (note: macOS 14 and earlier usebrew install jq)curlfor API requests- SimpleMDM API key
- Save script as
simplemdm_export.sh - Make executable:
chmod +x simplemdm_export.sh
Set your API key in one of these ways:
- Environment variable:
export API_KEY="your_simplemdm_api_key"
- Enter interactively when prompted
./simplemdm_export.sh [--force]--force: Bypass cache and refresh all data
Generated in /Users/Shared/simplemdm_export_YYYY-MM-DD_HHMM/:
simplemdm_devices_full_*.csv- All devices with complete detailssimplemdm_devices_needing_update_*.csv- Devices requiring OS updatessimplemdm_supported_macos_models_*.csv- Supported OS versions per modelsimplemdm_all_devices_*.json- Raw device data
- Device name & serial number
- Current OS version
- Update availability status
- Security features (FileVault, SIP, Firewall)
- Last seen timestamp
- Maximum supported macOS version
- Devices with available OS updates
- Key details for update prioritization
- Hardware model information
- Latest compatible macOS version
- Marketing names for devices
- API responses cached for 24 hours
- SOFA feed cached for 24 hours
- Use
--forceto ignore cache
API Key Errors
- Verify key has Device Read permissions
- Check for typos in key
- Ensure no trailing spaces
JSON Processing
- Verify
jqinstallation - Check script permissions
Network Issues
- Script includes 5 retry attempts with backoff
- Ensure outgoing HTTPS access to:
a.simplemdm.comsofafeed.macadmins.io
- Run initial export:
./simplemdm_export.sh
- Review
needs_updateCSV - Force refresh next day:
./simplemdm_export.sh --force
- Output directories automatically open in Finder
- Script handles pagination for large device lists
- Timestamps in UTC format --
"This bash script" will fetch SimpleMDM device list using your API key and check if any devices need updates and/or are compatible with the latest macOS.
Other examples add security info (filevault encryption and firewall status) or use of a custom attribute.
Added user-agent string per recommended best practises