8 Replies Latest reply: Sep 2, 2008 12:16 PM by RichB
Ken_Edgar Level 1 (30 points)
First of all, I'm sorry if this is the wrong place to pose this question.

I need to deploy a homepage setting change to a large amount of mac users in our enterprise... I'd like to accomplish this with ARD if possible. The change needs to affect all users on any given machine for both Safari and Firefox.

I have been able to make this change using write defaults to safari, but the change is only per user on each machine. I have not yet been able to do this with Firefox because I don't believe the setting is in a plist file.

I know the best route will probably be to write an apple script... but I'm a scripting novice.

Any suggestions?

Thank you,

400+ Clients spread across different locations, 3 Xserves, Mac OS X (10.5.1)
  • Ken_Edgar Level 1 (30 points)
    I'm going to reply to my own posting as this may be of interest to others out there.

    I have not developed a script, and the change will only work on a per logged in user basis.

    With Safari I'm just sending the command: defaults write com.apple.Safari Homepage 'http://homepage.com'

    In Firefox I edited /Applications/Firefox.app/Contents/MacOS/browserconfig.properties to reflect my homepage change. Then I will remove the user preferences for Firefox to force it to the default I just set in the file. rm ~/Library/Application\ Support/Firefox/Profiles/*.default/prefs.js

    I will mark this solved.
  • Ken_Edgar Level 1 (30 points)
    With Firefox I have noticed that if it is not installed, it will create the path in /Applications to firefox.app. This is a problem as it will confuse users. I'm going to be deploying the newest version of FireFox to each computer instead along with my edited prefs.js.
  • Ken_Edgar Level 1 (30 points)
    Taking another look at this (We haven't deployed the change yet) I think re-deploying the app is a bit of a harsh way around this problem. Along with one of my colleagues, we have come up with a perl script that will find the prefs.js file in each user profile and change only the homepage setting in those files. This will be run as root and will work even if a user is not logged in. I have tested this and it works well. I would be happy to share this with someone if anyone is interested.
  • wafi Level 1 (10 points)
    Ken_Edgar wrote:
    With Safari I'm just sending the command: defaults write com.apple.Safari Homepage 'http://homepage.com'

    thanks for this hint,
    I tried this but it doesn't work!!!!
    Did this command works probably with u??
  • Ken_Edgar Level 1 (30 points)
    Sorry... looks like it is case-sensitive and I typed it incorreclty here. Try this: "defaults write com.apple.Safari HomePage 'http://yourpage.com'"

    Message was edited by: Ken_Edgar
  • wafi Level 1 (10 points)
    Thanks Ken_Edgar, it's OK now,

    BTW, what is the recent commands u r using? Or do u have any place to find commands list or to learn how to deal with Unix command?

    Thanks in advance.
  • Ken_Edgar Level 1 (30 points)
    Hey man, With the help of one of my colleagues, we have written two different perl scripts in order to change the homepage for Safari and Firefox for all users on a given machine. Firefox was the easiest to do, but Safari interestingly enough, was the biggest pain.

    It turns out that with Safari, you can't change other users' preferences even if you are root. This was news to me... we ended up having to figure out the uid number of each user on the box... and running the command as each user to change each of their preferences. This script is pretty evil in what it does, and I don't think I should post it here.

    I haven't tested either script on a mass model yet, I have only tested it on a couple Leopard machines. Basically you will have to copy the script to a location on each machine using the copy feature of ARD... then when you want to deploy it, you just call that script from the send UNIX command in ARD.

    We only wrote the Safari script yesterday, and I need to go through and comment things and clean it up a bit. Please feel free to e-mail me directly if you want to take a look at the scripts... as said earlier, I don't feel like this is a good place to post some of this stuff as it could be dangerous. I also want to let you know that I don't want to be responsible for what these scripts may mess up. I think they are good, but like I said, I haven't done a lot of testing yet.
  • RichB Level 4 (1,565 points)
    We have many computers that were imaged with one user that boots to the desktop. We'd like to change the default home page on all these computers so what would the command script look like with one UID?