Mass copying preference files to user libarys

Ross2k6

Registered
Hello all,

When we want to make a change to a mac preference and wish to roll it out to all users we currently have to indivdually drop and drag the preference files to each and every user's preference libary. Is there a script or program that can copy preferences from one folder to each users libary preference folder. Hope that makes sense

So for example

copy the libary from (This location) to \accounts\(userid)\libary\preference

We have over 1000 users so you can see why this would be very helpful.

Look forward to your response.

Regards,

Ross
 
OK - we'll have to identify all of your users and the copy the preference.

I'ld use a bash script:
Code:
#!/bin/bash

declare -a userNames=( $(ls /accounts/) )

for userName in ${userNames[*]}
do
    cp -R -p ${1} /accounts/${userName}/Library/Preferences/.
    chown -R ${userName}:${userName} /accounts/${userName}/Library/Preferences/${1##/*/}
done

save it and chmod +x ; then invoke it with ./[scriptname] [path-to-file]
 
Back
Top