Default user desktop Pic in Yosemite

Philsto
New Contributor II

Has anyone figured out how to do this, so that associated new AD users all have the same background? I've seen numerous posts for the login page, and a number for Mavericks, including the derflounder post but nothing for desktop images for users on Yosemite.

Unless I'm missing something?

16 REPLIES 16

RogerH
Contributor II

I too have been trying to figure this out. I thought I had found the default picture but I was never able to get it to work.

rdwhitt
Contributor II

This may not be the best solution, but it works for my needs. I just deploy the image to a folder where we put various managed items, then run a script that replaces the DefaultDesktop.jpg symlink.

#!/bin/sh

# Remove existing symlink for DefaultDesktop.jpg

rm /System/Library/CoreServices/DefaultDesktop.jpg

# Add symlink for the new wallpaper
ln -s /path/to/new/DesktopPicture.png /System/Library/CoreServices/DefaultDesktop.jpg

All new users (AD or otherwise) will have the new desktop image.

Keep in mind that this doesn't change any existing user's desktop who may have already changed the background image to something else. I also don't prevent users from changing the background.

jacopo_pulici
Contributor

We're on Yosemite and I use a configuration profile > restrictions and set the path of an image deployed previously.
The users are not allowed to change desktop and therefore I also enable the option "don't allow user to change desktop picture" (if I recall correctly).

mm2270
Legendary Contributor III

On my Yosemite Macs there's a symlink (or alias) at:

/System/Library/CoreServices/DefaultDesktop.jpg

That points to this file

/Library/Desktop Pictures/Yosemite.jpg

Have you tried swapping that image for something else and seeing if that changes the default image for new accounts? You might need to make sure its the same aspect ratio and size, not sure. it would also need to be named the same thing.

bpavlov
Honored Contributor

@Jachk Interesting, I wonder if there's a way to make that profile so that it's set to ONCE rather than ALWAYS.

jacopo_pulici
Contributor

@bpavlov, you could package the profile and use it with a policy, therefore scope it to whoever you want, whenever you want (once, ongoing, ...).
I use this way to deploy our wifi config profile.

bpavlov
Honored Contributor

@Jachk I wasn't referring to the frequency of the policy, I meant whether the profile applies the setting ONCE or ALWAYS the way you can do that with custom profiles.

mm2270
Legendary Contributor III

I think what @bpavlov was saying is that Configuration Profiles can't be used in a once type setting, meaning, set the preference, but then let the user change it if they want. At least I have never seen a way to do that with them. MCX had that ability, but doesn't look like its possible with Config Profiles. This is a bit of a dilemma if you don't want to force a desktop image on everyone, but want to initially set one for new accounts.

OTOH, if you want/need to enforce the same image all the time, then the Config Profile will be perfect.

bpavlov
Honored Contributor

@mm2270 it is very much possible to create a config profile set to ONCE with MCXtoProfile. In fact I did it just today with Safari in Yosemite. That's why I was asking. I haven't tested the profiles and their behavior in Casper yet, but the mobielconfig definitely applies the settings I want ONCE and lets me change them afterwards. For example in Safari I set the homepage to what I wanted but I was then able to change it to something new since the profile was set to ONCE.

jacopo_pulici
Contributor

Now I got it, sorry.
What about something like a simple Applescript:

tell application "Finder"

set desktop picture to {"path to wallpaper.png"} as alias

end tell

You could deploy it combined with a policy.

mm2270
Legendary Contributor III

I have not been able to do this with our profiles, even ones I've converted to profiles using MCXtoProfile. The settings always get reverted. Are you sure the change you made to Safari's homepage stuck? Unless, maybe I need to manually edit the profile later with an additional key? If so, not sure what that is. Can you post an example of one of your converted profiles that works this way. I would like to modify some of ours to work this way since I'm not a big fan of forcing initial basic settings, like say, Finder settings on our staff.

bpavlov
Honored Contributor

Here is the plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>AutoOpenSafeDownloads</key>
    <false/>
    <key>ConfirmClosingMultiplePages</key>
    <true/>
    <key>HomePage</key>
    <string>http://www.mycompany.com</string>
    <key>NewTabBehavior</key>
    <integer>1</integer>
    <key>NewWindowBehavior</key>
    <integer>0</integer>
</dict>
</plist>

And the command I used:

/path/to/mcxToProfile.py -p "PathToPlist" -i "Application Name" -g "COMPANY, Inc." --displayname="COMPANY, Inc. - Application Name" -m "Once" -o "OutputPath/filename.mobileconfig"

To test if you want you can create two profiles. If you want to make it ALWAYS just remove -m "Once" as it will be ALWAYS by default.
I would just make sure to delete com.apple.safari.plist from ~/Library/Preferences and then run killall cfprefsd to make sure it's not reading from cached preferences.

Again I tried the profile outside of Casper and it worked. I have not tested it in Casper, but I would hope it works there too.

mm2270
Legendary Contributor III

Ok, thanks. I see what I was missing. Somehow when I looked through the documentation on MCXtoProfile I never saw the -m flag! So of course everything I was building out of the tool was being set to managed ALWAYS. Thanks for pointing this out, this is great information. Not sure how I missed that, but now I know!

bpavlov
Honored Contributor

Glad it helped. One thing I overlooked today but learned also is that you can have overlapping profiles. You need to make sure that the identifier is different for this to work (the -i option). With this method you can technically have some settings that are set ONCE by one profile and another set of settings that are set to ALWAYS with another profile. And both are managing the same plist! I ran into this with Safari because had some settings I wanted to manager ALWAYS and then the ones I posted above that I wanted just ONCE.

So it would look like this:

/path/to/mcxToProfile.py -p "PathToPlist" -i "Application Name (Always)" -g "COMPANY, Inc." --displayname="COMPANY, Inc. - Application Name" -o "OutputPath/filename.mobileconfig"
/path/to/mcxToProfile.py -p "PathToPlist" -i "Application Name (Once)" -g "COMPANY, Inc." --displayname="COMPANY, Inc. - Application Name" -m "Once" -o "DifferentOutputPath/filename.mobileconfig"

The -help options in MCXtoProfile are pretty useful. It's such an invaluable tool.

bentoms
Release Candidate Programs Tester

Someone should test the profiles with a once setting & confirm then still apply once when deployed via the JSS.

It looks like they might not.

bentoms
Release Candidate Programs Tester

As to the OP's issue.

We trigger a script @ login via a launchagent that sets (or resets) the background.

This is where I got the script, hat tip to @gregneagle for providing the solution.