Skip to main content
Question

Find My Mac Extension Attribute for Sonoma

  • Dec 20, 2023 4:59 PM UTC
  • 2 replies
  • 101 views

Forum|alt.badge.img+4

We have been using an EA to find Macs that have Find My enabled. It worked in Monterey and Ventura, but now in Sonoma it is coming up with blank results. 
Anyone have ideas how to correct it?

#!/bin/bash # iCloud_FindMyMac.sh # Purpose: to see if machine is enrolled in Find My Mac plistBud="/usr/libexec/PlistBuddy" loggedInUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }' ) if [[ -e "/Users/$loggedInUser/Library/Preferences/MobileMeAccounts.plist" ]]; then #FindMyMac=`$plistBud -c "print :Accounts:0:Services:11:Enabled" /Users/$loggedInUser/Library/Preferences/MobileMeAccounts.plist` FindMyMac=`$plistBud -c "print :Accounts:0:Services:" /Users/$loggedInUser/Library/Preferences/MobileMeAccounts.plist | grep FIND_MY_MAC -C1 | grep Enabled | awk '{print $3}'` else FindMyMac="Not Enabled" fi echo "<result>$FindMyMac</result>"

2 replies

wildfrog
Forum|alt.badge.img+12
  • Valued Contributor
  • Dec 20, 2023 8:26 PM UTC

This is what we're using - 

#!/bin/bash fmmToken=$(/usr/sbin/nvram -x -p | /usr/bin/grep fmm-mobileme-token-FMM) if [ -z "$fmmToken" ]; then echo "<result>Disabled</result>" else echo "<result>Enabled</result>" fi

Forum|alt.badge.img+7
  • Contributor
  • Dec 21, 2023 12:14 PM UTC

We use this, working for us in Sonoma:

 

#!/bin/sh

# Determine whether Find My Mac has been set on Mac.
# Values are stored in NRAM and will be: "Enabled" or "Disabled".

fmmToken=$(/usr/sbin/nvram -x -p | /usr/bin/grep "fmm-mobileme-token-FMM")

if [ -z "$fmmToken" ]; then
echo "<result>Disabled</result>"
else
echo "<result>Enabled</result>"

fi
exit 0