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

Call of Duty Warzone is a Waiting Simula...
It's always fun when a splashy multiplayer game comes to mobile because they are few and far between, so I was excited to see the notification about Call of Duty: Warzone Mobile (finally) launching last week and wanted to try it out. As someone who... | Read more »
Albion Online introduces some massive ne...
Sandbox Interactive has announced an upcoming update to its flagship MMORPG Albion Online, containing massive updates to its existing guild Vs guild systems. Someone clearly rewatched the Helms Deep battle in Lord of the Rings and spent the next... | Read more »
Chucklefish announces launch date of the...
Chucklefish, the indie London-based team we probably all know from developing Terraria or their stint publishing Stardew Valley, has revealed the mobile release date for roguelike deck-builder Wildfrost. Developed by Gaziter and Deadpan Games, the... | Read more »
Netmarble opens pre-registration for act...
It has been close to three years since Netmarble announced they would be adapting the smash series Solo Leveling into a video game, and at last, they have announced the opening of pre-orders for Solo Leveling: Arise. [Read more] | Read more »
PUBG Mobile celebrates sixth anniversary...
For the past six years, PUBG Mobile has been one of the most popular shooters you can play in the palm of your hand, and Krafton is celebrating this milestone and many years of ups by teaming up with hit music man JVKE to create a special song for... | Read more »
ASTRA: Knights of Veda refuse to pump th...
In perhaps the most recent example of being incredibly eager, ASTRA: Knights of Veda has dropped its second collaboration with South Korean boyband Seventeen, named so as it consists of exactly thirteen members and a video collaboration with Lee... | Read more »
Collect all your cats and caterpillars a...
If you are growing tired of trying to build a town with your phone by using it as a tiny, ineffectual shover then fear no longer, as Independent Arts Software has announced the upcoming release of Construction Simulator 4, from the critically... | Read more »
Backbone complete its lineup of 2nd Gene...
With all the ports of big AAA games that have been coming to mobile, it is becoming more convenient than ever to own a good controller, and to help with this Backbone has announced the completion of their 2nd generation product lineup with their... | Read more »
Zenless Zone Zero opens entries for its...
miHoYo, aka HoYoverse, has become such a big name in mobile gaming that it's hard to believe that arguably their flagship title, Genshin Impact, is only three and a half years old. Now, they continue the road to the next title in their world, with... | Read more »
Live, Playdate, Live! – The TouchArcade...
In this week’s episode of The TouchArcade Show we kick things off by talking about all the games I splurged on during the recent Playdate Catalog one-year anniversary sale, including the new Lucas Pope jam Mars After Midnight. We haven’t played any... | Read more »

Price Scanner via MacPrices.net

Deal Alert! B&H Photo has Apple’s 14-inch...
B&H Photo has new Gray and Black 14″ M3, M3 Pro, and M3 Max MacBook Pros on sale for $200-$300 off MSRP, starting at only $1399. B&H offers free 1-2 day delivery to most US addresses: – 14″ 8... Read more
Department Of Justice Sets Sights On Apple In...
NEWS – The ball has finally dropped on the big Apple. The ball (metaphorically speaking) — an antitrust lawsuit filed in the U.S. on March 21 by the Department of Justice (DOJ) — came down following... Read more
New 13-inch M3 MacBook Air on sale for $999,...
Amazon has Apple’s new 13″ M3 MacBook Air on sale for $100 off MSRP for the first time, now just $999 shipped. Shipping is free: – 13″ MacBook Air (8GB RAM/256GB SSD/Space Gray): $999 $100 off MSRP... Read more
Amazon has Apple’s 9th-generation WiFi iPads...
Amazon has Apple’s 9th generation 10.2″ WiFi iPads on sale for $80-$100 off MSRP, starting only $249. Their prices are the lowest available for new iPads anywhere: – 10″ 64GB WiFi iPad (Space Gray or... Read more
Discounted 14-inch M3 MacBook Pros with 16GB...
Apple retailer Expercom has 14″ MacBook Pros with M3 CPUs and 16GB of standard memory discounted by up to $120 off Apple’s MSRP: – 14″ M3 MacBook Pro (16GB RAM/256GB SSD): $1691.06 $108 off MSRP – 14... Read more
Clearance 15-inch M2 MacBook Airs on sale for...
B&H Photo has Apple’s 15″ MacBook Airs with M2 CPUs (8GB RAM/256GB SSD) in stock today and on clearance sale for $999 in all four colors. Free 1-2 delivery is available to most US addresses.... Read more
Clearance 13-inch M1 MacBook Airs drop to onl...
B&H has Apple’s base 13″ M1 MacBook Air (Space Gray, Silver, & Gold) in stock and on clearance sale today for $300 off MSRP, only $699. Free 1-2 day shipping is available to most addresses in... Read more
New promo at Visible: Buy a new iPhone, get $...
Switch to Visible, and buy a new iPhone, and Visible will take $10 off their monthly Visible+ service for 24 months. Visible+ is normally $45 per month. With this promotion, the cost of Visible+ is... Read more
B&H has Apple’s 13-inch M2 MacBook Airs o...
B&H Photo has 13″ MacBook Airs with M2 CPUs and 256GB of storage in stock and on sale for $100 off Apple’s new MSRP, only $899. Free 1-2 day delivery is available to most US addresses. Their... Read more
Take advantage of Apple’s steep discounts on...
Apple has a full line of 16″ M3 Pro and M3 Max MacBook Pros available, Certified Refurbished, starting at $2119 and ranging up to $600 off MSRP. Each model features a new outer case, shipping is free... Read more

Jobs Board

Medical Assistant - Surgical Oncology- *Apple...
Medical Assistant - Surgical Oncology- Apple Hill Location: WellSpan Medical Group, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply 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
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
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
Business Analyst | *Apple* Pay - Banco Popu...
Business Analyst | Apple PayApply now " Apply now + Apply Now + Start applying with LinkedIn Start + Please wait Date:Mar 19, 2024 Location: San Juan-Cupey, PR Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.