Posted on 02-15-2021 03:20 AM
Hi all
Is there any way that we can find out what is the current Apple ID on the Mac ??
Solved! Go to Solution.
Posted on 02-15-2021 07:36 AM
I use the following EA to grab the user signed into iCloud:
#!/bin/sh
## Get logged in user
loggedInUser=$(stat -f%Su /dev/console)
icloudaccount=$( defaults read /Users/$loggedInUser/Library/Preferences/MobileMeAccounts.plist Accounts | grep AccountID | cut -d '"' -f 2)
if [ -z "$icloudaccount" ]
then
echo "<result>No Accounts Signed In</result>"
else
echo "<result>$icloudaccount</result>"
fi
Posted on 02-15-2021 07:36 AM
I use the following EA to grab the user signed into iCloud:
#!/bin/sh
## Get logged in user
loggedInUser=$(stat -f%Su /dev/console)
icloudaccount=$( defaults read /Users/$loggedInUser/Library/Preferences/MobileMeAccounts.plist Accounts | grep AccountID | cut -d '"' -f 2)
if [ -z "$icloudaccount" ]
then
echo "<result>No Accounts Signed In</result>"
else
echo "<result>$icloudaccount</result>"
fi
Posted on 02-18-2021 12:20 AM
thanks a lot works just fine
Posted on 10-26-2021 12:40 AM
Thanks for the script, works great. However, it would be awesome if the results could be written into a file (let's say, on a server). How would one achieve that, without having to go through each individual Mac in the logs of the script to check for the results?
Posted on 04-26-2023 12:19 AM
This can be done with ExtensionAttribute. But sadly, I am no expert in this and would like to know how to do it.