You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Plist File for Screen Saver and Password Settings

I am a remote access administrator for my company. I am working on posture policies to ensure certain settings are configured on devices prior to being allowed remote access. I need to read settings from plist files to verify compliance.


Which plist file contains the settings for the circled settings below? They are not in com.apple.screensaver.plist (this file is blank on my Mac), nor are they in com.apple.loginwindow.plist. The 2 uncircled settings are in com.apple.PowerManagement.plist, but that file does not contain the password settings.



Any assistance is greatly appreciated




Posted on Jan 9, 2025 6:41 AM

Reply
1 reply

Jan 9, 2025 5:34 PM in response to jjstipe

The first one is stored in the dreaded ByHosts preferences. The path to this is unique per device and user. Since that one is harder, I will skip it and talk about the second one first.


To validate the "require password after..." setting, use the following command:


sysadminctl -screenLock status


If the setting is at Immediate, the result will be something like:


<a bunch of junk> screenLock delay is immediate


Build in a parser to validate "immediate" and you are set.


Ok, back to the first one. The file is located in /Users/<the_user>/Library/Preferences/ByHosts and is called com.apple.screensaver.<GUID>.plist. The GUID is unique to each Mac. If you want to get the value to derive the path the hard way, use something like:


system_profiler SPHardwareDataType | awk '/UUID/ { print $NF }'


However, the easiest way to read this is:


defaults -currentHost read com.apple.screensaver idleTime


This will return the time in seconds. And this assumes you are running this locally from the user's account. Note, the idleTime can be set per user. If your Macs have multiple users, then each has a unique setting and you must then validate each user's ByHost file. Yuck.


So, this is where I strongly encourage you to enforce these settings using an MDM. If you are manually setting and then checking these values, you are doing way, way too much work. Use an MDM to enforce the values, and then use a compliance tool like Jamf Protect or others to constantly validate the enforcement.


Hope this is helpful.

Plist File for Screen Saver and Password Settings

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.