Skip to main content
Question

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

  • March 19, 2026
  • 6 replies
  • 102 views

FerrisBNA
Forum|alt.badge.img+4

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

 

6 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

 

 

 


FerrisBNA
Forum|alt.badge.img+4
  • Author
  • 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

For this script, wouldn’t the logged-in user need to be an administrator?

-Pat


mfletch
Forum|alt.badge.img+9
  • Contributor
  • March 20, 2026

I use desktoppr and it works great.

 

https://github.com/scriptingosx/desktoppr


Forum|alt.badge.img+2
  • New Contributor
  • March 25, 2026

That prompt is macOS TCC for Apple Events (Jamf/osascript trying to automate Finder). If you want to avoid user prompts entirely, I’ve had the best luck using desktoppr (no Finder automation) or Jamf’s wallpaper payload.

If you do stick with AppleScript, you’ll need to pre-approve the automation via a PPPC profile (AppleEvents) so Jamf/osascript is allowed to control Finder.

Reference (walkthrough + what to whitelist): Apple Privacy Preferences (PPPC) Policy