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

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 »
Summon your guild and prepare for war in...
Netmarble is making some pretty big moves with their latest update for Seven Knights Idle Adventure, with a bunch of interesting additions. Two new heroes enter the battle, there are events and bosses abound, and perhaps most interesting, a huge... | Read more »
Make the passage of time your plaything...
While some of us are still waiting for a chance to get our hands on Ash Prime - yes, don’t remind me I could currently buy him this month I’m barely hanging on - Digital Extremes has announced its next anticipated Prime Form for Warframe. Starting... | Read more »
If you can find it and fit through the d...
The holy trinity of amazing company names have come together, to release their equally amazing and adorable mobile game, Hamster Inn. Published by HyperBeard Games, and co-developed by Mum Not Proud and Little Sasquatch Studios, it's time to... | Read more »
Amikin Survival opens for pre-orders on...
Join me on the wonderful trip down the inspiration rabbit hole; much as Palworld seemingly “borrowed” many aspects from the hit Pokemon franchise, it is time for the heavily armed animal survival to also spawn some illegitimate children as Helio... | Read more »
PUBG Mobile teams up with global phenome...
Since launching in 2019, SpyxFamily has exploded to damn near catastrophic popularity, so it was only a matter of time before a mobile game snapped up a collaboration. Enter PUBG Mobile. Until May 12th, players will be able to collect a host of... | Read more »
Embark into the frozen tundra of certain...
Chucklefish, developers of hit action-adventure sandbox game Starbound and owner of one of the cutest logos in gaming, has released their roguelike deck-builder Wildfrost. Created alongside developers Gaziter and Deadpan Games, Wildfrost will... | Read more »

Price Scanner via MacPrices.net

Limited-time sale: 13-inch M3 MacBook Airs fo...
Amazon has the base 13″ M3 MacBook Air (8GB/256GB) in stock and on sale for a limited time for $989 shipped. That’s $110 off MSRP, and it’s the lowest price we’ve seen so far for an M3-powered... Read more
13-inch M2 MacBook Airs in stock today at App...
Apple has 13″ M2 MacBook Airs available for only $849 today in their Certified Refurbished store. These are the cheapest M2-powered MacBooks for sale at Apple. Apple’s one-year warranty is included,... Read more
New today at Apple: Series 9 Watches availabl...
Apple is now offering Certified Refurbished Apple Watch Series 9 models on their online store for up to $80 off MSRP, starting at $339. Each Watch includes Apple’s standard one-year warranty, a new... Read more
The latest Apple iPhone deals from wireless c...
We’ve updated our iPhone Price Tracker with the latest carrier deals on Apple’s iPhone 15 family of smartphones as well as previous models including the iPhone 14, 13, 12, 11, and SE. Use our price... Read more
Boost Mobile will sell you an iPhone 11 for $...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering an iPhone 11 for $149.99 when purchased with their $40 Unlimited service plan (12GB of premium data). No trade-in is required... Read more
Free iPhone 15 plus Unlimited service for $60...
Boost Infinite, part of MVNO Boost Mobile using AT&T and T-Mobile’s networks, is offering a free 128GB iPhone 15 for $60 per month including their Unlimited service plan (30GB of premium data).... Read more
$300 off any new iPhone with service at Red P...
Red Pocket Mobile has new Apple iPhones on sale for $300 off MSRP when you switch and open up a new line of service. Red Pocket Mobile is a nationwide MVNO using all the major wireless carrier... Read more
Clearance 13-inch M1 MacBook Airs available a...
Apple has clearance 13″ M1 MacBook Airs, Certified Refurbished, available for $759 for 8-Core CPU/7-Core GPU/256GB models and $929 for 8-Core CPU/8-Core GPU/512GB models. Apple’s one-year warranty is... Read more
Updated Apple MacBook Price Trackers
Our Apple award-winning MacBook Price Trackers are continually updated with the latest information on prices, bundles, and availability for 16″ and 14″ MacBook Pros along with 13″ and 15″ MacBook... Read more
Every model of Apple’s 13-inch M3 MacBook Air...
Best Buy has Apple 13″ MacBook Airs with M3 CPUs in stock and on sale today for $100 off MSRP. Prices start at $999. Their prices are the lowest currently available for new 13″ M3 MacBook Airs among... Read more

Jobs Board

Solutions Engineer - *Apple* - SHI (United...
**Job Summary** An Apple Solution Engineer's primary role is tosupport SHI customers in their efforts to select, deploy, and manage Apple operating systems and Read more
DMR Technician - *Apple* /iOS Systems - Haml...
…relevant point-of-need technology self-help aids are available as appropriate. ** Apple Systems Administration** **:** Develops solutions for supporting, deploying, 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.