Skip to content

Instantly share code, notes, and snippets.

@AndrewWCarson
Created June 6, 2019 20:30
Show Gist options
  • Save AndrewWCarson/3385e44f07b08784576a64860592c6ac to your computer and use it in GitHub Desktop.
Save AndrewWCarson/3385e44f07b08784576a64860592c6ac to your computer and use it in GitHub Desktop.
Outputs True/False based on the device "Supervised" status (determined by whether the device has gone through Device Enrollment provisioning).
#!/bin/bash
if /usr/libexec/mdmclient QuerySecurityInfo | grep -m1 EnrolledViaDEP | grep 1 >&/dev/null; then
echo "True"
else
echo "False"
fi
@AndrewWCarson
Copy link
Author

This is particularly useful now that macOS Catalina differentiates between UAMDM and "Supervised" Mac devices. For instance, the new Get the Bypass Code for Activation Lock is only compatible with Supervised devices (https://developer.apple.com/documentation/devicemanagement/get_the_bypass_code_for_activation_lock).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment