Changing wallpaper on new users computer

I’m learning to love Jamf every day and this time it’s the simple task of setting the wallpaper for newly installed computers

.

There is a simple way to setup a Wallpaper with a configuration profile. However, this will force the wallpaper and people will not be able to replace it later. I did not want that functionality.

I found a nice method that I’ll describe here that ended up working for me. One thing to note is that I do not have DEP and the policy runs from the users account that I manually create on the Mac.

The first part is straightforward. I packaged the wallpaper PNG file to be deployed to the users’ document folder with the Jamf composer. I used FEU (Fill existing user home directories) to make sure it goes to the users home folder and does not create one with my username in the path. Then I exported to a dmg file as .pkg files will not work with FEU.

Next, I used this amazing tool called Desktopper on Github. Packaged it and deploy the .pkg in the same policy. With Desktopper you can point it at the PNG file I copied to the users’ Documents folder and set it on the some or all displays as the wallpaper.

I could use the “Files and Processes” section of the policy but then the desktoppr will run as the root user and will not give me the result I want.

The solution I ended up using is called Outset and can be found on Github and…. it is awesome. Outset is a script which automatically processes packages, profiles, and scripts during the boot sequence, user logins, or on demand.

What I need to do is put create a script with the correct permissions, that will run the desktoppr and set the PNG file. That script went to the “login-once” folder of Outset. This way the script will apply the wallpaper after the first login for every user on this Mac. Added it to the scripts in Jamf. This was the last piece of the puzzle.

#!/bin/bash
## Create a script in the outset Run-Once folder
cat <<EOF>> /usr/local/outset/login-once/SetWallpaper.sh
#!/bin/bash
/usr/local/bin/desktoppr main ~/Documents/FBwallpaper.png
EOF

## Give the script execute permission
chmod +x /usr/local/outset/login-once/SetWallpaper.sh

As scope, I set up a new smart group that includes all of our user machines that were enrolled in the last day. I do not want this to replace the wallpaper of my CEOs favorite cat or something. So that’s it, guys. Please let me know if you have a better way to get the job done or any questions.

3 thoughts on “Changing wallpaper on new users computer

  1. Hi Alex:)

    a simple way doing it with jamf.

    1. First you can copy your picture desktop to it’s destination default folder ‘”/Library/Desktop Pictures/” .
    you can use composer, just make sure the user is “root” and group is “wheel” set to 755 as like in upper folder “Desktop Pictures”.
    Screen-Shot-2018-12-03-at-16-17-53

    2. In Jamf, run policy install package with enrolment trigger.
    Screen-Shot-2018-12-03-at-16-24-03

    3. write a bash script : osascript -e ‘tell application “System Events” to set picture of every desktop to (“Path of image” as POSIX file as alias)’
    Screen-Shot-2018-12-03-at-16-31-16

    4. Scope the script create above to your desired device/group with “Login” trigger and “EXECUTION FREQUENCY” frequency
    Screen-Shot-2018-12-03-at-16-35-15

    thats it 😉
    hope you’ll find it useful.

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s