As user-level MCX is flaky or does not not work at all (usually the latter), I had to work around having MCX fail to apply the "Require password" setting in Sys Pref - Security - General.
We have not yet pulled the trigger on MDM (soooon) so I had to get this setting re-applied in the meantime. I wrote this script to address this issue; its an AppleScript wrapped in a Bash script which has the ability to check to see if the screensaver is active or not so that the script will not fail with an error -10810 (requires GUI).
Check it out and let me know what you think! Its working well for me set to check-in and ongoing and available offline (i want this to be as persistent as possible).
#!/bin/bash
# Check to see if the screensaver is active
ps ax|grep [S]creenSaverEngine > /dev/null
# If not active, apply screensaver setting
if [ "$?" != "0" ] ; then
osascript -e 'tell application "System Events" to set require password to wake of security preferences to true'
echo "screensaver was not active. script ran."
# If active bail out
else
echo "screensaver is active. bailing."
fi
