MacOS – Change Security & Privacy setting from terminal

macosSecurity

I need to enable the "Require an administrator password to access locked preferences" on about a dozen Macs. I would like to do it from ARD as a unix command. Is this possible?

Best Answer

Using AppleScript :

tell application "System Events"
    tell security preferences
    set properties to {require password to unlock:true}
    end tell
end tell

You can call the Applescript code using the osascript command.