Wallpaper Changes

billystanton29
New Contributor II

Hi All,

We are looking to change our company wallpaper on our Mac's, and in past we have done this by saving the image to a test Mac, and using composer to create a DMG of the folder location.

We then push this folder out to users, and once pushed out, we changed the filename on a restrictions config profile.

The problem we have now, is that we have a mixture of APFS and Mac OS Journaled devices, so the composer route seems to add a bit more complication.

Can anybody advise on a better way of doing this?

Thank you!

1 ACCEPTED SOLUTION

Hugonaut
Valued Contributor II

as far as distribution goes,

you could always host the file on a server..and do the following via jamf with shell or applescript - then set the config profile to the path specified?

#!/usr/bin/osascript

set UNAME to "username"
set PASSW to "password"

try
    do shell script "mkdir /Library/DirectoryHere/" user name UNAME password PASSW with administrator privileges
end try

try
    do shell script "curl -o /Library/DirectoryHere/WallpaperHere.jpg  http://server.com/wallpapers/Wallpaper.jpg" user name UNAME password PASSW with administrator privileges
end try
________________
Looking for a Jamf Managed Service Provider? Look no further than Rocketman
________________


Virtual MacAdmins Monthly Meetup - First Friday, Every Month

View solution in original post

5 REPLIES 5

bumbletech
Contributor III

You can do this with a configuration profile in the Restrictions payload under "Functionality." Use composer to make a pkg with your picture (/Library/Desktop Pictures/ would be a good place), and then use your custom picture's path in the profile.

The downside is if you just want to make this a default and let the user change it, the "Lock desktop picture" check box state seems to be ignored—at least when i've played around with it.

dsavageED
Contributor III

A small piece of python can be used to set the desktop in a login triggered policy:

#!/usr/bin/python

from AppKit import NSWorkspace, NSScreen
from Foundation import NSURL
from subprocess import call
from os import system
import sys

picture_path = str(sys.argv[4]) # jamf variable for the script
#picture_path = "/Library/Desktop Pictures/Bahamas Aerial.jpg"

file_url = NSURL.fileURLWithPath_(picture_path)
options = {}
ws = NSWorkspace.sharedWorkspace()
for screen in NSScreen.screens():
    (result, error) = ws.setDesktopImageURL_forScreen_options_error_(file_url, screen, options, None)

vaksai
New Contributor II

I have a first-run policy that triggers when a user logs in for the first time that executes the following command, the picture is dropped in a folder by an enrollment completed policy:

currentUser=$(/bin/ls -l /dev/console | /usr/bin/awk '{print $3}'); sudo -u $currentUser -H osascript -e 'tell application "Finder" to set desktop picture to POSIX file "/path/to/wallpaper.jpg"'

Hugonaut
Valued Contributor II

as far as distribution goes,

you could always host the file on a server..and do the following via jamf with shell or applescript - then set the config profile to the path specified?

#!/usr/bin/osascript

set UNAME to "username"
set PASSW to "password"

try
    do shell script "mkdir /Library/DirectoryHere/" user name UNAME password PASSW with administrator privileges
end try

try
    do shell script "curl -o /Library/DirectoryHere/WallpaperHere.jpg  http://server.com/wallpapers/Wallpaper.jpg" user name UNAME password PASSW with administrator privileges
end try
________________
Looking for a Jamf Managed Service Provider? Look no further than Rocketman
________________


Virtual MacAdmins Monthly Meetup - First Friday, Every Month

billystanton29
New Contributor II

Thank you!

This is what I was after, an alternative method of pushing the image out.

Thanks all!