Add Extension Attribute to Check the Parental Control Status
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
04-13-2017
07:48 PM
- last edited on
03-04-2025
05:26 AM
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
0 REPLIES 0
