In the technology, security is a number one need for most organizations. So my security department tasked me with the want to be able to see what settings user’s are using for their iCloud.
So I decided I would create a nifty little tool that would be used as an extension attribute. It’s pretty straight forward on how it make it work. Go into your JSS and create a new extension attribution. You can name it whatever you like.
Next select the option on the extension attribute to be a script. Then here comes the meat of the solution.
Paste the following lines into the script box:
#!/bin/bash
#############################################################
# Purpose: To report on the status of iCloud Preferences
# Author: GaToRAiD (Andrew Barrett)
# Date: 11/3/14
# Version: 2.0
#############################################################
for ((i=0; i<12; i++));
do
Service=`/usr/libexec/PlistBuddy -c “Print Accounts:0:Services:$i” “/Users/abarrett/Library/Preferences/MobileMeAccounts.plist”`
serviceName=`echo “$Service” | egrep “Name” | awk -F’ ‘ {‘print $3′}`
serviceStatus=`echo “$Service” | egrep “Enabled” | awk -F’ ‘ {‘print $3′}`
if [[ -z “$serviceStatus” ]]; then
serviceStatus=`echo “$Service” | egrep “beta” | awk -F’ ‘ {‘print $3’}`
fi
serviceInfo=”${serviceInfo}\n Service Name: $serviceName\n Service Status: $serviceStatus”
done
echo -e “<result>$serviceInfo</result>”
#############################################################
Now this is not going to be a realtime option for my security department, as I have one but currently as I write this article, Rest API is not working the way it should. Once this has been fixed I will post a new article with a tool that is near realtime to alert you on iCloud preferences.