Looks like no one’s replied in a while. To start the conversation again, simply ask a new 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 Nov 15, 2017 8:53 AM

Reply
Question marked as Best reply

Posted on Nov 15, 2017 9:29 AM

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!

2 replies
Question marked as Best reply

Nov 15, 2017 9:29 AM 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!

Dec 11, 2017 12:25 PM 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?

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

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