10-31-2023 01:30 PM - edited 10-31-2023 01:31 PM
We have profiles set up to disable iCloud in Settings for our student macbooks, but some have figured out how to add their accounts anyway via other apps tied into iCloud. Is there a script that will force the removal of an iCloud account from a DEP device? I tried some of the old ones from 5-6 years ago and they no longer function.
Second question, is there a way to detect what devices have iCloud accounts on them from Jamf Pro?
Posted on 10-31-2023 05:57 PM
We restrict all built-in apps that can log into iCloud. I don't think you can force log out. We only had 1 student logged in due to the profile and Ventura issue. I just lock the student's laptop so they have to come to us to unlock and log out their iCloud account.
Forgot where I got this EA from.
#!/bin/sh
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>"
fi
Posted on 11-02-2023 07:31 AM
This helps. Thanks