Skip to main content
Solved

Finding out what machines have iCloud enabled?

  • January 19, 2023
  • 2 replies
  • 29 views

Forum|alt.badge.img+3

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.

Best answer by sassy_p

This has helped us achieve the same thing, returning an extension attribute in which we can then create a smart group from the results

https://github.com/palantir/jamf-pro-scripts/blob/main/extension-attributes/iCloud%20Services%20Enabled.zsh

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

2 replies

sassy_p
Forum|alt.badge.img+6
  • Contributor
  • 13 replies
  • Answer
  • January 20, 2023

This has helped us achieve the same thing, returning an extension attribute in which we can then create a smart group from the results

https://github.com/palantir/jamf-pro-scripts/blob/main/extension-attributes/iCloud%20Services%20Enabled.zsh

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


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 4 replies
  • January 27, 2023

This has helped us achieve the same thing, returning an extension attribute in which we can then create a smart group from the results

https://github.com/palantir/jamf-pro-scripts/blob/main/extension-attributes/iCloud%20Services%20Enabled.zsh

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


That worked! Thanks so much!