Posted on 04-21-2016 10:47 PM
Hi All,
Have been attempting to push out a set desktop background for all users in the org.
Not sure if I've got the right way about it but i have setup a pkg to push to all devices on the network which contains the .jpg file i wish to set. thats works fine.
however when i the script thats meant to set the picture run it keeps failing.
if i set that particular rule to be available by self service it works fine.
please see attachment for error message.
Posted on 04-21-2016 11:25 PM
I normally do this with an OS X configuration profile. The restrictions payload has an option to set the desktop background.
On a side note, I generally put the JPG in /Library/CompanyName along with any company specific stuff. Any tmp or system directories may get wiped out by Apple or the vendor.
Posted on 04-22-2016 03:53 AM
I do this in 2 steps. One policy that just install the image in /Library/Desktops. Then one policy run this script to set the picture:
osascript -e 'tell application "Finder" to set desktop picture to POSIX file "/Library/Desktop Pictures/Custom.jpg"'
I might very well be a login script of you want to set it every time a user logs in.
Posted on 05-02-2016 08:01 PM
Hi All, Thanks for the responses, the script posted by @Joppmann seems to be doing the trick, however it only seems to set the Background Picture of the Primary Display. I'm trying to get this to set all Display's to the defined Desktop Background.
I can't seem to find a way to make the above script work for that, all i can find is...
tell application "System Events" to set picture of every desktop to "/Library/Desktop Pictures/Lion.jpg"
this works if entered in AppleScript / SelfService (Casper) but not if i set as a policy, when reading the logs i get what is seen in the above screenshot,
Thanks for you help on this.
Posted on 05-16-2016 08:39 PM
Hi All, Have been making some progress here,
Have created a policy which runs the "File and Processes" command
osascript -e 'tell application "System Events" to set picture of every desktop to "/Library/Desktop Pictures/Lion.jpg"'
If i enable this in Self Service it works fine, with the below message. (Desktop Pictures on both desktops set)...
[STEP 1 of 4]
Executing Policy Set Desktop Background
[STEP 2 of 4]
[STEP 3 of 4]
Running command osascript -e 'tell application "System Events" to set picture of every desktop to "/Library/Desktop Pictures/Lion.jpg"'...
Result of command:
[STEP 4 of 4]
However if i set it up to run as a recurring task and deploy automatically i get the below...
Executing Policy Set Desktop Background
Running command osascript -e 'tell application "System Events" to set picture of every desktop to "/Library/Desktop Pictures/Lion.jpg"'...
Result of command:
36:104: execution error: An error of type -10810 has occurred. (-10810)
Have tried a number of different variations but always seems to bring back the same result.
The Script offered by Björck appears to work fine either Auto Deployed or Self Service however only sets the image on 1x screen. :(
Posted on 05-17-2016 01:56 AM
Does the error occur when the user is logged in or is it when the Mac is at the login Window?
Posted on 05-17-2016 02:09 AM
@andrew.nguyen Is this background to be always set?
Posted on 05-18-2016 04:45 PM
Hi Guys, @davidacland ,I have the script to run at Login & Recurring @bentoms , Yes we would like to set this as the default background premamently
Cheers
Posted on 05-19-2016 12:13 AM
@andrew.nguyen under Configuration Profiles, there is a restrictions payload that can force the desktop.
You'll need to deploy the image, then specify it's path in the profile.