Skip to main content
Question

Deploying a default Wallpaper using script is prompting users to "allow"

  • March 19, 2026
  • 3 replies
  • 25 views

FerrisBNA
Forum|alt.badge.img+3

Hello all,

   I am working on deploying the updated company wallpaper.  Current attempt is using the script below, but it gives the user a that “Jamf wants access to control Finder...” (screenshot attached). Maybe there is a better way to do this.

 

#!/bin/sh

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 "/Library/DesktopWallpaper/backgroundDefault.jpg"'

exit 0

 

3 replies

MusicCityMac
Forum|alt.badge.img+15
  • Jamf Heroes
  • March 19, 2026

Take a look at this guide from Jamf on deploying wallpaper to a computer. 


dmccluskey
Forum|alt.badge.img+8
  • Valued Contributor
  • March 19, 2026

You need to use a apple script this will avoid any prompts.

This is an example of the one I use.

 

#!/bin/bash
# $3 is the logged in user - default for most policies.  
sudo -u $3 /usr/bin/osascript <<ENDofOSAscript
tell Application "Finder"
set the desktop picture to {"Library:corp:wallpaper:General.jpg"} as alias
end tell
ENDofOSAscript
exit 0


Forum|alt.badge.img+8
  • Contributor
  • March 19, 2026

Give Desktoppr a try. I use this to set a default background on our staff users with the option to change it. It works quite well with a launch agent. 
 

https://github.com/scriptingosx/desktoppr