Last active
May 17, 2022 19:17
-
-
Save jps3/6f779bbc694e644e8964e83f12b4ec6a to your computer and use it in GitHub Desktop.
Jamf Pro Computer Extension Attribute for status of firmware password check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sysctl hw.optional.x86_64
is set to1
for Intel (nothing returned if not set)sysctl hw.optional.arm64
is set to1
for Apple Silicon (nothing returned if not set)