Apple often write some really nice software, and occasionally the documentation can even be good. Sometimes though there are some rather head-scratching changes, and the changes to ByHost preferences in Leopard are some of them. A bit of background first is probably in order…
ByHost preferences are preferences that are specific to a particular machine, if they’re used to another machine (or are in your home folder on a network account and you log in to another Mac) then they won’t be applied. If you look in your user Preferences folder, there will be a ByHost folder. Inside there there will be a lot of plist files that contain a series of numbers and letters. For instance on my MacBook here, this is sat in /Users/james/Library/Preferences/ByHost:
com.apple.Bluetooth.998***57-1A8E-**B7-9EAE-3D*******246a.plist
I’ve removed a few numbers there so I’m not advertising too much about my Mac, but you get the general idea.
Where things get fun is that prior to Leopard, the MAC address (ie hardware ethernet address) was used to make ByHost preferences unique. This would leave files looking a bit like:
com.apple.screensaver.001fac78b2.plist
Some made up numbers there, but again you get the gist. Now with Leopard some Macs started using a new UUID scheme. You can get your UUID by running this code in the Terminal:
ioreg -rd1 -c IOPlatformExpertDevice | grep -E '(UUID)'
Oddly though some machines (especially older machines) still use the MAC address scheme, and some machines (such as mine) have an even newer scheme mixed in there as well. I’ve not yet tracked down exactly what that is based on, but my original example of the Bluetooth plist is neither my MAC address, nor obviously UUID based.
So, all a bit confusing, but we probably passed the “so what” point 12 lines ago. I’m getting there, slowly at least. One big problem with ByHost preferences is that the screensaver is set by a ByHost preference. Not a huge deal for most users, but often corporate users want to enforce a standard screensaver across all their Macs using Open Directory to push out MCX settings. That’s not a problem for most preferences but with Leopard there’s a few strange things going on. First of all Workgroup Manager lets you import plists to manage settings for which there is no dedicated GUI. There’s also a checkbox that lets you select to “Import as ByHost Preference”. That’s great, except it doesn’t work in a number of ways. It is fixable in some circumstances though.
Firstly, you want to add your plist from a Leopard Mac (server or otherwise) to Workgroup Manager so that you can control the preference on client Macs. However if you choose a ByHost preference on a Mac using the new UUID or the even newer scheme, the “Import as ByHost” option is greyed out. To get it to work isn’t too bad, but a bit unexpected, you need to convert the name of the plist to the old MAC style format. To get your MAC address check System Profiler, or type this into the Terminal:
ifconfig en0 | grep ether
That will return the MAC address of what is your first ethernet adapter (normally wired ethernet) in the format of 00:23:ab:xx:xx:xx. Get rid of the colons and rename the filename of the plist you want to import with the MAC address, eg. com.apple.screensaver.slideshow.0023abxxxxxx.plist. Workgroup Manager will now let you import this with the “Import as ByHost” option checked. Once it’s in it will then be shown as com.apple.screensaver.slideshow.ByHost.
In that particular case you can now add a new key, SlideFolder, to that imported plist to set the path to a slideshow folder (as a string). Couple that with the normal screensaver settings, com.apple.screensaver.Byhost and you’re halfway there. The best way to get the normal screensaver settings in is to add /System/Library/Core Services/ManagedClient.app to the Details pane in Workgroup Manager. You also get a ton of other handy manifests.
Onto the second problem; before 10.5.6, ByHost preferences in Leopard just didn’t work. Effectively they were pushing out the MAC address version of the preferences which newer Macs were ignoring, seemingly expecting the UUID based settings. With 10.5.6 Apple changed things a little and ByHost preferences for screensaver settings are now supported and indeed do seem to work.
This leaves a few questions though. While I can see some reasons why the UUID was used instead of the MAC address, why has it seemingly been changed again, and why are some Macs using a mix, and some still using the MAC address based system? Also why does Workgroup Manager still only accept the MAC based ByHost Preferences as being ByHost? Finally are Apple going to support any other ByHost settings, other than screensaver settings, via MCX at some point?
It’s all a little puzzling and unfortunately very badly documented.
Previous Entry: "New iMacs, Mac minis and Mac Pros"
Next Entry: "Here kitty kitty..."
Copyright © The Mac Place 2009. Design:Highground Valid XHTML 1.1