Skip to main content
Question

Remove iCloud Account from Macbooks

  • October 31, 2023
  • 2 replies
  • 86 views

jhathcock
Forum|alt.badge.img+7

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?

2 replies

YanW
Forum|alt.badge.img+11
  • Contributor
  • November 1, 2023

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

 


jhathcock
Forum|alt.badge.img+7
  • Author
  • Contributor
  • November 2, 2023

This helps.  Thanks