Re: Al Users with PackageMaker
Re: Al Users with PackageMaker
- Subject: Re: Al Users with PackageMaker
- From: Chris Devers <email@hidden>
- Date: Mon, 8 Feb 2010 17:07:22 -0500
On Mon, Feb 8, 2010 at 3:23 PM, Russ Miller <email@hidden> wrote:
> OK, I'd like to distribute preference files to all users on all machines on
> my network. Is there a way or a wildcard to install say "all
> users"/Library/Preferences since having multiple users on each machine (Open
> Directory) makes an absolute path irrelevant? I'd like to kick this package
> out over ARD.
It's not for a package installer, but I have a shell script that works
similarly, and might be adaptable for your needs. It needs to be run
with admin/root privs, so a postflight installer script ought to work.
plistpath="Library/Preferences/com.acme.roadrunnerzapper"
property="dynamite"
value="kaboom"
for dsuser in `dscl . -list /Users | egrep -v '_|daemon|root'
do
dshome=`dscl . read /users/$dsuser NFSHomeDirectory | awk '{print $2}'
plist="$dshome/$plistpath"
defaults read $plist $property
defaults write $plist $property $value
sleep 1
defaults read $plist $property
done
This will consult the local Open Directory database, get a list of
non-system accounts (there's actually a bunch more than the above, but
I'm getting main ones in for clarify; re-run `dscl . -list /Users` to
see all of them). Then, for each one, it just figures out their home
directory, constructs a .plist file based on that path, then uses
`defaults` to write the setting you want into each of those, whether
or not it previously existed. Then it reads back the value to make
sure the change worked as expected.
If you already have a canned, working, portable .plist file, then you
could replace the `defaults` commands with the right `cp $source
$plist` line to put your version in place.
Hope this helps.
--
Chris Devers
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden