I'm writing a script to check for security compliance on a number of computers and wanted to verify that the user has set the computer to require a password immediately after sleep or screensaver. Basically I want to verify the status of this preference pane:
I've found information here:
And elsewhere that suggests the answer is to do this:
defaults -currentHost read com.apple.screensaver askForPassword
defaults read com.apple.screensaver askForPassword
but that setting doesn't appear to be set in High Sierra in either place and doesn't change when I change the length of time from
Immediately to something else.
Any ideas where I might find this information in a command-line accessible manner? I kind of want the equivalent of FileVault's
fdesetup status (or equivalent way to get that data) but for this setting.