Posted on
04-13-2017
07:48 PM
- last edited
Tuesday
by
kh-richa_mig
Here are two scripts can be used to create the extension attribute to check the Parental Control status on Client, take it if you need. I'm not good at coding, but they work.
#!/bin/sh
find /Library/Managed Preferences/*/ -name "com.apple.familycontrols.logging.plist" > /tmp/pc.txt
FILE=find /Library/Managed Preferences/*/ -name "com.apple.familycontrols.logging.plist" -print -quit
if [ -f "$FILE" ]; then
USERS=cut -d"/" -f4 /tmp/pc.txt
echo "<result>Enabled on Users: $USERS</result>"
else
echo "<result>Not Enabled</result>"
fi
#!/bin/sh
USERS=dscl . -readall /Users MCXSettings | awk -v RS="-" '{for (i=NF; i>=2; i--) if ($i ~ /RecordName:/ && $(i-1) != 0 ) print $(i+1) }'
if [ "$USERS" ]; then
echo "<result>Enabled on Users: $USERS</result>"
else
echo "<result>Not Enabled</result>"
fi