TweetFollow Us on Twitter

MacEnterprise: Screen Saver and loginwindow: Friends at Last

Volume Number: 26
Issue Number: 01
Column Tag: system administration

MacEnterprise: Screen Saver and loginwindow: Friends at Last

Using MCX to manage a new Snow Leopard feature

by Greg Neagle

Introduction

A couple of months ago, we looked at some of the new features in Snow Leopard. I noted that the screen saver now runs over the loginwindow - a feature I've asked for since 2001, when OS X was first released! But when I wrote that particular column, I had not yet discovered how to control the time before the screen saver activates, or how to specify which screen saver module runs. The answer, not surprisingly, is to use MCX - Apple's method for managing preferences. So this month, we'll look at controlling Snow Leopard's loginwindow screen saver, and along the way, talk about MCX in general. If you don't or can't use MCX in your environment, don't worry - we'll also look at a way to manage the loginwindow screen saver using the defaults command.

You may be asking yourself - why does anyone want a screen saver over the loginwindow? Even if they are worried about display "burn-in", why don't they just set the display to dim or the machine to sleep after a period of inactivity? Dimming the display or sleeping the machine might be good choices for some organizations. But in instructional labs, students gravitate towards machines that look "alive", and may assume a machine with a dark display is broken. In my environment, some of our machines are connected to color-calibrated CRT displays that must be kept "warm" to retain their calibration. Shutting down the machine or putting it to sleep causes the display to go cold and require time-consuming recalibration. In other organizations, there might be a desire to run a screen saver over the loginwindow that acts as an informational display. Also, many organizations want to leave their machines on and awake when no one is logged in so that administrative tasks can be performed in the off-hours. Whatever the reason you might need or want to run a screen saver over the Login Window, you finally have an Apple-supported method to do so. Prior to Snow Leopard, OS X administrators had to resort to all sorts of hacks and tricks to get Apple's screen saver or a pale third-party imitation to work over loginwindow.

MCX for everyone

If you aren't using MCX to manage your OS X machines, you really should be. If your machines are on Leopard or later, there's really no reason any longer not to; you don't need to have an Open Directory server; you don't need to extend your LDAPv3 or Active Directory schema. You can put your MCX management settings on the local computer using a technique referred to as Local MCX.

For more information on Local MCX, you can refer to past MacEnterprise columns in MacTech:

"MCX- No Excuses, Now!", MacTech, Volume 24, Issue 11, November 2008

http://www.mactech.com/articles/mactech/Vol.24/24.11/2411MacEnterprise-MCX-NoExcuses/index.html

"Loco for Local MCX", MacTech, Volume 25, Issue 2, February 2009

(available online in Feb, 2010)

Some additional Local MCX resources:

http://www.afp548.com/article.php?story=using-mcx-in-the-dslocal-domain

http://managingosx.wordpress.com/2008/02/07/mcx-dslocal-and-leopard/

http://www.macos.utah.edu/documentation/administration/local_mcx.html

http://homepage.mac.com/gregneagle/files/MW2009_IT803.pdf/P>

For the remainder of this column, I'll be using Local MCX to demonstrate the techniques, but they'll work with a traditional network directory-based MCX deployment as well.

Workgroup Manager

To configure the loginwindow screen saver using MCX, you'll want to use Workgroup Manager 10.6 or later. As of this writing, you can get the 10.6.2 version of the Server Administration Tools, which includes Workgroup Manager, at this URL:

http://support.apple.com/downloads/DL968/en_US/ServerAdminTools10.6.2.dmg

Open Workgroup Manager, connect to the directory service you are using (network or local), and select a Computer or Computer Group to manage. If you're following along and are trying this out, you might want to create a new computer group to experiment with; this allows you to experiment without affecting any existing computers or computer groups. When you are done experimenting, you can simply delete the computer group you created, and all your experimental detritus will be cleanly removed.

When managing the screen saver over the loginwindow, preference management must be done at the computer or computer group level. These preferences are not associated with individual users - in most cases, no user will be logged in when we're at the loginwindow, so user or group preferences would not be available.

For this column, I've created a Computer Group called loginwindowscreensaver, added my local test machine to the group, and then clicked on Preferences in the toolbar. The result is shown in Figure 1.


Figure 1 - Workgroup Manager preferences management

Click the Login preferences and select the Options tab, which should display a pane like that in Figure 2.


Figure 2 - Login preferences Options tab

At the bottom of the Options pane, you'll see the new options for managing the screen saver over loginwindow. You can set the idle time after which the screen saver starts, and specify which screen saver module runs. Make your choices, click Apply Now, and Done. That was easy! Any computers that are part of the computer group you are managing will now get these new preferences.

While this is a nice, easy-to-use interface for managing the loginwindow screen saver, in practice it can present a problem. If you use this pane, all of the settings in the pane are managed as a group. You may want to manage the loginwindow screen saver, but leave other loginwindow options alone; this interface doesn't really allow for that. If you use this interface, you cannot manage the screen saver at the loginwindow without also managing automatic login, Fast User Switching, external accounts and more. This may not be what you want. You might be looking for something a little more granular.

Editing Details

Fortunately, there is an alternate interface that gives you finer-grained control. If you refer back to Figure 1, you'll see that the Workgroup Manage preferences editor has two tabs: Overview and Details. The Login pane is available via the Overview tab. But we can get more precise control (and more options) by using the Details pane. If you are still in the Login preferences editor pane, click Done to return to the Overview, then click the Details tab. If you haven't imported any preference manifests yet, it will look something like Figure 3.


Figure 3 - Preference details

If you have previously imported some preference manifests, you will have additional entries, but that's not important right now. What we're interested in are the entries that have the gray circle with a white mouse pointer icon in the first column. These are the preferences we set as managed when using the Login pane under the Overview tab. We can now do some surgery so we are managing only the screen saver preferences.

If you examine the contents of com.apple.screensaver (as in Figure 4), you'll see that the loginWindowIdleTime and loginWindowModulePath are being managed, so you can just delete all of the other managed preferences; none of them will be managed.

Deleting .GlobalPreferences, com.apple.loginwindow, com.apple.MCX, and com.apple.systempreferences causes all of the preferences included in those domains to revert to being unmanaged. Now computers that are members of our loginwindowscreensaver group will receive managed preferences only for the com.apple.screensaver domain.


Figure 4 - com.apple.screensaver Managed Preferences

Once you've made these changes, if you go back to the Overview and look at the Login preferences you'll see all sorts of strange "half-checked" options, because the current settings no longer match anything that can be cleanly represented in the Overview interface. Once you start fine-tuning using the Details interface, you cannot use the Overview interface without erasing your detail work.

Preference Manifests

There is another way to work with Workgroup Manager, which is to use preference manifests. This method allows us to do all the work in the Details interface. If you're following along, and have taken my advice and are using a newly created computer group to test these settings, delete all of your managed preferences so you are working with a clean slate.

We'll start by adding in the new preference manifests for Snow Leopard, if you haven't already done so. In the Details preferences editor pane, click on the plus icon in the lower left. Navigate to /System/Library/CoreServices, select ManagedClient, and click Add.


Figure 5 - Imported preference manifests

You should see something similar to Figure 5. Adding ManagedClient.app imports a number of useful preference manifests, but the one we're interested in today is Screen Saver Loginwindow, or com.apple.screensaver, which should sound familiar.

Double-click Screen Saver Loginwindow. Select Always, and turn down the disclosure triangle. Click the New Key button. Click the new key's title - New Item - and select Login Window Idle Time from the pop-up menu. Click New Key again, and change the New Item to Login Window Screen Saver Module Path. The results should look like Figure 6.


Figure 6 - Screen Saver Loginwindow managed preferences

This is functionally identical to editing the "bare" com.apple.screensaver preferences, but if you use the Screen Saver Loginwindow preferences manifest, Apple gives you a little more information to work with. For the Login Window Screen Saver Module Path key, Apple has provided some info to let you know that not all screen savers will work over the loginwindow, so you must test. The Login Window Idle Time help text lets you know that setting this value to 0 disables the screen saver at the loginwindow.

Require Password

One more advantage to using the preference manifest - it can help you discover other settings that can be managed. When adding the new keys, you may have noticed another possible choice: Require Password. This key allows you to manage the setting to require a password after waking from sleep or clearing the screen saver. This is an important setting in many organizations to enforce computer security, and setting this via MCX in Leopard was tricky - Leopard's preference manifests contained only a manifest for com.apple.screensaver.ByHost, but setting Require Password there did not provide the desired result. To make things work, you needed to import preferences for com.apple.screensaver (minus the ByHost) and manage those as well. With Snow Leopard, Apple's cleaned this up so things behave as you'd expect.

Require password delay

To manage this preference, we need to discover the name of the preference key, so first we'll set it manually. Open System Preferences and choose the Security preference pane. Check Require password, and set the delay to 1 minute. Figure 7 shows the settings.


Figure 7 - Require password settings

Close System Preferences. Now we'll use the defaults command to find the name of the preference key we're looking for. We know the other key (askForPassword) is stored in com.apple.screensaver, so let's look there first:

> defaults read com.apple.screensaver
{
    askForPassword = 1;
    askForPasswordDelay = 60;
    tokenRemovalAction = 0;
}

askForPasswordDelay looks like what we need. Returning to Workgroup Manager, we can use the Screen Saver Loginwindow preference manifest to add the Require Password key. To manage the askForPasswordDelay key, just add a new key, click on its name and choose Edit. This allows us to add key names that aren't in the preferences manifest. You can type askForPasswordDelay as the name of the key. Change its type to Integer, and for the value, type the number of seconds you'd like as the delay before a password is required. When you're done, it should look like Figure 8. Note the Name doesn't match preference manifest warning - we can ignore this since we added this key intentionally.


Figure 8 - com.apple.screensaver managed preferences

Click Apply Now and Done, and log out and back in on a computer that is a member of the computer group you are testing with. If you open System Preferences and click the Security pane, you should see something like Figure 9. Note that Require password is checked, the delay is set to one minute (or whatever you set it to) and both controls are disabled, indicating to the user that they cannot change them.


Figure 9 - Managed screen saver password preferences

Other options

If you absolutely cannot or will not use MCX, even via Local MCX, all is not lost. You can still manage the screen saver over loginwindow, and can at least set a default behavior for Requires password and the delay.

To accomplish these tasks without using MCX, we can use the defaults command. To manage the screen saver over the login window (watch the line breaks - there are two commands here; each should be all on one line):

defaults write /Library/Preferences/com.apple.screensaver  
   loginWindowIdleTime -int 300
defaults write /Library/Preferences/com.apple.screensaver 
   loginWindowModulePath 
   "/System/Library/Screen Savers/Flurry.saver"

If your users don't have admin rights, this is virtually identical to using MCX to manage this, as there's no standard user-accessible way to change or override these settings.

You can also set Require password and its delay (again, two commands, each all on one line):

defaults write /Library/Preferences/com.apple.screensaver 
   askForPassword -int 1
defaults write /Library/Preferences/com.apple.screensaver 
   askForPasswordDelay -int 60

Unfortunately, for these particular settings, this is a poor substitute for MCX, as the user can override these settings with a visit to the Security pane in System Preferences. Without MCX, these controls will remain available in the Security pane, and the users may change them at will. Also, any pre-existing user preferences for the screen saver will still be applied. To come closer to enforcing these preferences, you'd have to write a script that deleted these preferences from the user's home directory so they wouldn't override the ones set in /Library/Preferences/com.apple.screensaver.plist, and also perhaps figure out a way to deny the users access to the Security preference pane. Once you start writing scripts to manage preferences that can be managed via MCX, you're better off investing the effort in getting Local MCX working.

Since these defaults settings are all stored in a single file - /Library/Preferences/com.apple.screensaver.plist - you could also use a software delivery tool like radmind or LANrev or Casper to simply install that file with the appropriate contents. Again, this would be effective for managing the screen saver over the Login Window, but less so for requiring a screen saver password.

Conclusion, and the future...

So there you have it. Apple has provided a new feature in Snow Leopard - the screen saver can now run over the Login Window. Even better, they've made sure it can be managed via MCX. We looked at several methods for specifying our managed preferences, using Apple's tools. And we also looked at a way to control the screen saver over the loginwindow even without using MCX.

Where might you go from here? If one of your goals was to manage the loginwindow screen saver so you could display a set of images that are specific to your organization - for example, artwork from your company, or images from a company event, or even advertising, you'll probably want to create your own slideSaver, and manage its preferences. But that will have to wait for another time! See you next month.


Greg Neagle is a member of the steering committee of the Mac OS X Enterprise Project (macenterprise.org) and is a senior systems engineer at a large animation studio. Greg has been working with the Mac since 1984, and with OS X since its release. He can be reached at gregneagle@mac.com.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Fallout Shelter pulls in ten times its u...
When the Fallout TV series was announced I, like I assume many others, assumed it was going to be an utter pile of garbage. Well, as we now know that couldn't be further from the truth. It was a smash hit, and this success has of course given the... | Read more »
Recruit two powerful-sounding students t...
I am a fan of anime, and I hear about a lot that comes through, but one that escaped my attention until now is A Certain Scientific Railgun T, and that name is very enticing. If it's new to you too, then players of Blue Archive can get a hands-on... | Read more »
Top Hat Studios unveils a new gameplay t...
There are a lot of big games coming that you might be excited about, but one of those I am most interested in is Athenian Rhapsody because it looks delightfully silly. The developers behind this project, the rather fancy-sounding Top Hat Studios,... | Read more »
Bound through time on the hunt for sneak...
Have you ever sat down and wondered what would happen if Dr Who and Sherlock Holmes went on an adventure? Well, besides probably being the best mash-up of English fiction, you'd get the Hidden Through Time series, and now Rogueside has announced... | Read more »
The secrets of Penacony might soon come...
Version 2.2 of Honkai: Star Rail is on the horizon and brings the culmination of the Penacony adventure after quite the escalation in the latest story quests. To help you through this new expansion is the introduction of two powerful new... | Read more »
The Legend of Heroes: Trails of Cold Ste...
I adore game series that have connecting lore and stories, which of course means the Legend of Heroes is very dear to me, Trails lore has been building for two decades. Excitedly, the next stage is upon us as Userjoy has announced the upcoming... | Read more »
Go from lowly lizard to wicked Wyvern in...
Do you like questing, and do you like dragons? If not then boy is this not the announcement for you, as Loongcheer Game has unveiled Quest Dragon: Idle Mobile Game. Yes, it is amazing Square Enix hasn’t sued them for copyright infringement, but... | Read more »
Aether Gazer unveils Chapter 16 of its m...
After a bit of maintenance, Aether Gazer has released Chapter 16 of its main storyline, titled Night Parade of the Beasts. This big update brings a new character, a special outfit, some special limited-time events, and, of course, an engaging... | Read more »
Challenge those pesky wyverns to a dance...
After recently having you do battle against your foes by wildly flailing Hello Kitty and friends at them, GungHo Online has whipped out another surprising collaboration for Puzzle & Dragons. It is now time to beat your opponents by cha-cha... | Read more »
Pack a magnifying glass and practice you...
Somehow it has already been a year since Torchlight: Infinite launched, and XD Games is celebrating by blending in what sounds like a truly fantastic new update. Fans of Cthulhu rejoice, as Whispering Mist brings some horror elements, and tests... | Read more »

Price Scanner via MacPrices.net

Verizon has Apple AirPods on sale this weeken...
Verizon has Apple AirPods on sale for up to 31% off MSRP on their online store this weekend. Their prices are the lowest price available for AirPods from any Apple retailer. Verizon service is not... Read more
Apple has 15-inch M2 MacBook Airs available s...
Apple has clearance, Certified Refurbished, 15″ M2 MacBook Airs available starting at $1019 and ranging up to $300 off original MSRP. These are the cheapest 15″ MacBook Airs for sale today at Apple.... Read more
May 2024 Apple Education discounts on MacBook...
If you’re a student, teacher, or staff member at any educational institution, you can use your .edu email address when ordering at Apple Education to take up to $300 off the purchase of a new MacBook... Read more
Clearance 16-inch M2 Pro MacBook Pros in stoc...
Apple has clearance 16″ M2 Pro MacBook Pros available in their Certified Refurbished store starting at $2049 and ranging up to $450 off original MSRP. Each model features a new outer case, shipping... Read more
Save $300 at Apple on 14-inch M3 MacBook Pros...
Apple has 14″ M3 MacBook Pros with 16GB of RAM, Certified Refurbished, available for $270-$300 off MSRP. Each model features a new outer case, shipping is free, and an Apple 1-year warranty is... Read more
Apple continues to offer 14-inch M3 MacBook P...
Apple has 14″ M3 MacBook Pros, Certified Refurbished, available starting at only $1359 and ranging up to $270 off MSRP. Each model features a new outer case, shipping is free, and an Apple 1-year... Read more
Apple AirPods Pro with USB-C return to all-ti...
Amazon has Apple’s AirPods Pro with USB-C in stock and on sale for $179.99 including free shipping. Their price is $70 (28%) off MSRP, and it’s currently the lowest price available for new AirPods... Read more
Apple Magic Keyboards for iPads are on sale f...
Amazon has Apple Magic Keyboards for iPads on sale today for up to $70 off MSRP, shipping included: – Magic Keyboard for 10th-generation Apple iPad: $199, save $50 – Magic Keyboard for 11″ iPad Pro/... Read more
Apple’s 13-inch M2 MacBook Airs return to rec...
Apple retailers have 13″ MacBook Airs with M2 CPUs in stock and on sale this weekend starting at only $849 in Space Gray, Silver, Starlight, and Midnight colors. These are the lowest prices currently... Read more
Best Buy is clearing out iPad Airs for up to...
In advance of next week’s probably release of new and updated iPad Airs, Best Buy has 10.9″ M1 WiFi iPad Airs on record-low sale prices for up to $200 off Apple’s MSRP, starting at $399. Sale prices... Read more

Jobs Board

Liquor Stock Clerk - S. *Apple* St. - Idaho...
Liquor Stock Clerk - S. Apple St. Boise Posting Begin Date: 2023/10/10 Posting End Date: 2024/10/14 Category: Retail Sub Category: Customer Service Work Type: Part Read more
*Apple* App Developer - Datrose (United Stat...
…year experiencein programming and have computer knowledge with SWIFT. Job Responsibilites: Apple App Developer is expected to support essential tasks for the RxASL Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.