Skip to content

Instantly share code, notes, and snippets.

@jps3
Last active May 17, 2022 19:17
Show Gist options
  • Save jps3/6f779bbc694e644e8964e83f12b4ec6a to your computer and use it in GitHub Desktop.
Save jps3/6f779bbc694e644e8964e83f12b4ec6a to your computer and use it in GitHub Desktop.
Jamf Pro Computer Extension Attribute for status of firmware password check
#!/bin/bash
#
# Created by jps3@lehigh.edu on 2021-08-22
#
# Jamf Pro > Settings > Computer Management > Extension Attributes
# Display Name : firmwarepasswd-check
# Description : Report result of firmware password check.
# Data Type : String
# Inventory Display : Hardware
# Input Type : Script
#
#
# This is only valid for Intel-based EFI Macs.
# Returns error message to stderr, usage to stdout, and exits non-zero (5) on Apple Silicon
#
RESULT="$(/usr/sbin/firmwarepasswd -check | awk -F ": " '$1=="Password Enabled" { print $2 }')"
if [[ -n "$RESULT" ]]; then
echo "<result>${RESULT}</result>";
fi
exit 0
@jps3
Copy link
Author

jps3 commented May 17, 2022

  • sysctl hw.optional.x86_64 is set to 1 for Intel (nothing returned if not set)
  • sysctl hw.optional.arm64 is set to 1 for Apple Silicon (nothing returned if not set)

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