We are considering disabling iCloud within our organization but we want to know how many of our users are actually using it. Does anyone have a command or know of a policy that we can create to return back which computers have iCloud enabled?
Who is using iCloud - Command
Best answer by mm2270
I don't know if there's a specific command that would do that, but I just hacked a quick and dirty script together that would pull any iCloud account emails together along with the user they are associated with, and can be put into an Extension Attribute.
I only tested this on my Mac, and only with my iCloud account set up on it, so I have no idea how well it would work in a multi-user setup. It should pull a list of any users on the Mac with iCloud accounts set up. but I can't really test that.
Anyway, it might be a start. Here it is:
#!/bin/bash
for user in $(ls /Users/ | grep -v Shared); do
if [ -d "/Users/$user/Library/Application Support/iCloud/Accounts" ]; then
Accts=$(find "/Users/$user/Library/Application Support/iCloud/Accounts" | grep '@' | awk -F'/' '{print $NF}')
iCloudAccts+=(${user}: ${Accts})
fi
done
echo "<result>$(printf '%s
' "${iCloudAccts[@]}")</result>"
Just one thing. Since this pulls email addresses associated with the iCloud account, it might constitute an invasion of privacy in some environments, so just be sure you are allowed to even collect this data before doing anything like this. I know some Casper Suite customers have had to proactively disable many features of the product to have it allowed to be used in the company. For ex, even collecting application usage is a big issue with some labor unions in some countries.
OTOH, if that isn't an issue for you, you could use the data to email the person that you may in the future be disabling iCloud on your network, so they have a heads up on that.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
