Hello everyone,
I would need a little help from the scripting gurus out there to create an Extension Attribute to gather screensaver's "askForPassword" status in inventory for 10.10.x/10.11.x clients.
The below works for "IdleTime" but not for "askForPassword"... (The domain/default pair of (/Users/username/Library/Preferences/ByHost/com.apple.screensaver, askForPassword) does not exist)
#!/bin/sh
CONSOLE_USER_NAME="$(/usr/bin/stat -f "%Su" /dev/console)"
idleTime=`sudo -u $CONSOLE_USER_NAME defaults -currentHost read com.apple.screensaver idleTime`
echo "<result>$idleTime</result>"
although
defaults read com.apple.screensaver askForPassword
works locally from Terminal and as an ARD unix command sent as the logged user
What am I missing?
Many thanks for your help!
Carlo

