Prevent users from changing wallpaper

I saw a post on here about how to prevent users from changing their wallpaper, but the link was dead and a new link was not posted. Basically, I work in a school where the kids love to have their wallpaper represent their love for weapons, video games and other things that do not necessarily belong in a school. They have figured out how to get around my disabling backgrounds in system preferences, so the only way I can see is to lock down the desktop .plist file. The problem is, is that going through 400 users to lock their file one by one is too tedious. Is there a script that can do this for me? I am not exactly a pro when it comes to scripts or terminal commands. Any help would be much appreciated.

Intel iMac 17", Mac OS X (10.5.3), Lab full 'o' iMacs

Posted on Oct 14, 2008 10:27 AM

Reply
5 replies

Oct 16, 2008 3:18 PM in response to gambier

Set up an account (ideally on a machine with workgroup manager installed) with a background that you want. Ideally this will be an image that is on all of the machines you wish to manage. Using one of the predefined Apple images works. Log into workgroup manager and select the group or computer list you wish to manage. Click on the preferences for the group and then Details. Click on the plus side to add a new preference manage. Navigate to the ~/Library/Preferences folder of the account you had set up previously and then select the com.apple.desktop.plist file. By default the settings for this file (such as desktop image) are set to be managed Once. Meaning that they will be set when the user logs in but can be changed after that. To change this click on the settings you want to have managed all the time. Then click copy. Highlight the word Always and then paste. When asked if you want to replace the MCX settings select yes. Apply and done. Users will then all have the background you defined and will not able to change it via any method. Of course locking the desktop preference is a good move too.
My apologies if any of my wording is a little off as I'm not currently sitting in front of a computer with workgroup manager.

Oct 16, 2008 3:59 PM in response to gambier

Well in that case! Here is my best attempt. It is basically a script that will allow you to replace the file via ftp, all you will have to do is enter the IP User and Password for each user, it will do the rest. Since you are managing the computers you will first have to turn on ssh and file sharing using ftp. Then assuming you have no terminal experience whatsoever do the following. Open up terminal and cd to a good directory to make a script in, I like using ~/Scripts/ a folder you will have to create if its not already there.

cd ~/Scripts/

Then once in ~/Scripts type:

nano ftpscript.sh

Then press enter. This will create the script file and open up nano which is a command line text editor. Now copy and paste this script into the window.

#!/bin/bash
+echo -n "enter ftp address"+
+read HOST+
+echo -n "enter User name"+
+read USER+
+echo -n "enter password"+
+read PASSWD+

+ftp -n $HOST <<END_SCRIPT+
+quote USER $USER+
+quote PASS $PASSWD+
+put ~/Library/Preferences/com.apple.desktop.plist ~/Library/Preferences/com.apple.desktop.plist
quit
END_SCRIPT
+exit 0+

Then press control (not apple) and x at the same time. Then type:
chmod 755 ftpscript.sh

now your script is ready and executable.

Before you execute the script set your desktop background to the background you want the students to have, and lock the com.apple.desktop.plist file.

Once all that is set you can type ./ftpscript.sh

Bada bing bada boom, it still leaves you with a entering in 400 user name IP and passwords, but if you have an admin account on all the computers you can replace that script with the one below which will only leave you entering in the IP for each comp.


#!/bin/bash
+echo -n "enter ftp address"+
+read HOST+
*USER=Put your admin user name here*
*PASSWD=Put your admin password here*

+ftp -n $HOST <<END_SCRIPT+
+quote USER $USER+
+quote PASS $PASSWD+
+put ~/Library/Preferences/com.apple.desktop.plist ~/Library/Preferences/com.apple.desktop.plist
quit
END_SCRIPT
+exit 0+


Hope this helps!
adam

Oct 16, 2008 4:02 PM in response to Tom Rice

Tom Rice wrote:
Set up an account (ideally on a machine with workgroup manager installed) with a background that you want. Ideally this will be an image that is on all of the machines you wish to manage. Using one of the predefined Apple images works. Log into workgroup manager and select the group or computer list you wish to manage. Click on the preferences for the group and then Details. Click on the plus side to add a new preference manage. Navigate to the ~/Library/Preferences folder of the account you had set up previously and then select the com.apple.desktop.plist file. By default the settings for this file (such as desktop image) are set to be managed Once. Meaning that they will be set when the user logs in but can be changed after that. To change this click on the settings you want to have managed all the time. Then click copy. Highlight the word Always and then paste. When asked if you want to replace the MCX settings select yes. Apply and done. Users will then all have the background you defined and will not able to change it via any method. Of course locking the desktop preference is a good move too.
My apologies if any of my wording is a little off as I'm not currently sitting in front of a computer with workgroup manager.


This seems like a better way, nice to know! Hopefully my script will be of some help if you do decide to lockdown the plist file

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Prevent users from changing wallpaper

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.