Announcement: Upgrade to macOS Mojave

With features like Dark Mode, Stacks, and four new built-in apps, macOS Mojave helps you get more out of every click. 
Find out how to upgrade to macOS Mojave > https://support.apple.com/macos/mojave

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Question:

Question: How to set Safari homepage from Terminal? (Or Config profile?)

Hello. I have 80 Macs, each with between 5-10 users (already created), who all need Safari's homepage set to a single site. In previous years, I found this to be an easy task. I could simply modify each user's com.apple.Safari HomePage key to force the user's homepage. I have also accomplished the same task system-wide by simply copying a correctly configured plist into a configuration profile and pushing this out through Profile Manager.


However, things seem to be different now. The devices are all running 10.12.6. I'd heard reports that the homepage was no longer set on these iMacs recently, but I don't know when the issue actually began. In attempting to create a new configuration profile, I've found that there is no HomePage key listed after adding the plist. I've been digging in deeper, trying to get a sense as to why simply using defaults to write the key to a given user's plist doesn't work anymore.


I've found a couple of oddities that I can't explain just yet. Firstly, when I use this command to modify a user's plist:

sudo defaults write /Users/<username>/Library/Preferences/com.apple.Safari.plist HomePage -string "http://school.website.com"

I'm immediately able to turn around and use defaults to read that the key was correctly written. However, after subsequently launching Safari and discovering that the HomePage has not been changed, I use defaults to read the key a second time and it's no longer there. The plist is getting overwritten when Safari launches.


Secondly, I manually set the homepage via Safari simply to http://www.cnn.com and tried to track down where in the user's Preferences it might be stored by doing the tried-and-true split/half method, by removing half of the Preferences and checking to seen when the homepage changes back to default. This has always helped me identify specific preferences, cache files, etc. that have been causing problems. Much to my dismay, even after completely removing the entire Preferences folder from the user account, logging out and back in (allowing a new Preferences folder to be rebuilt), Safari still displays http://www.cnn.com as the homepage! That really threw me for a loop. I have found that a complete rebuild of the entire Library does reset the homepage, so the setting is stored somewhere in the Library... but where?


Any help would be greatly appreciated!

Mac mini, OS X Server, OS X 10.12.6 with Server 5.3

Posted on

Reply

Page content loaded

Nov 15, 2017 9:29 AM in response to atoss In response to atoss

UPDATE: Shortly after posting, I did keep working at the Library folder and found that the homepage gets reset to default after removing the Keychains folder! I never would have thought to look in Keychains. I'm still investigating what element inside the folder holds this data. Any advice is still appreciated! Thanks!


UPDATE #2: I have found it! keychain-2.db is the place where the homepage is stored. Pulling this file and logging back into the user resets the homepage to default. Putting the same file back and then logging back into the user puts it's back to CNN. Now... if I could only figure out how to use this info to be able to deploy to hundreds of users!

Nov 15, 2017 9:29 AM

Reply Helpful (1)

Dec 11, 2017 12:25 PM in response to atoss In response to atoss

I'm trying to figure out using Meraki mobile device management how to set certain config profiles to push out a specific Homepage url to dozens of iPads. Having to type this in on each iPad I setup is a pain. Considering I'm able to do so many other automated tasks. Meraki is great and I do have an Apps settings section, however, I need specific keys/type/value to accomplish this. Any thoughts? Were you able to push your url out to the devices?

Dec 11, 2017 12:25 PM

Reply Helpful
User profile for user: atoss

Question: How to set Safari homepage from Terminal? (Or Config profile?)