Skip to main content

Hi all
Is there any way that we can find out what is the current Apple ID on the Mac ??

@mo.halabia



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

@stevewood



thanks a lot works just fine


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?


This can be done with ExtensionAttribute. But sadly, I am no expert in this and would like to know how to do it.  


Reply