01-19-2023 02:34 PM - edited 01-19-2023 02:35 PM
Looking through the archives has done me no favors, I need a way to find out which users/Macs have iCloud enabled. At some point I need to disable iCloud outright and knowing how many users have it enabled would be extremely helpful.
Solved! Go to Solution.
01-19-2023 10:11 PM - edited 01-19-2023 10:16 PM
This has helped us achieve the same thing, returning an extension attribute in which we can then create a smart group from the results
Hopefully this helps, we also have another that returns the email address used…
#!/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>Null</result>"
else
echo "<result>$icloudaccount</result>"
Cannot credit either script to myself but if I find the author I certainly will
01-19-2023 10:11 PM - edited 01-19-2023 10:16 PM
This has helped us achieve the same thing, returning an extension attribute in which we can then create a smart group from the results
Hopefully this helps, we also have another that returns the email address used…
#!/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>Null</result>"
else
echo "<result>$icloudaccount</result>"
Cannot credit either script to myself but if I find the author I certainly will
Posted on 01-27-2023 01:48 PM
That worked! Thanks so much!