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>"