Replace homepage campus wide

jmercier
Contributor II

Hi,

Usually i can manage myself to find solutions to any demands we have, but i have been knocking my head with this one... looks like there is something i don't see....

we have 500 mac computers and (unfortunately) our Communications Dept. changed the College web site address, and now i need to change that default value on all mac computers, labs and administrative ones...

Been reading all posts here and on the web and looks like really hard now changing that value for Safari, and i did not even took a look at others like chrome yet...

But if i could manage to find that solution for Safari at least... would be great...

Need to change that value in the template section, which we already have our custom template when we image computers... but changing that value makes the template unusable....

Need also to change that value for all users profiles in computers already created....

Tried many solutions... nothing works...

any little help ?

28 REPLIES 28

joshuasee
Contributor III

Hmm. Since nobody else seems to have chimed in yet, I'll note that the jamf binary has a handy function for this:

bash-3.2$ jamf help setHomePage

Usage:   jamf setHomePage -homepage <homepage> [-feu] [-fut] [-username <username>]
         [-removeDownloadLocation] [-skipIE] [-skipFirefox] [-skipMozilla] [-skipSafari]


 -homepage       The URL for the homepage

     -feu            Set the homepage for existing users

     -fut            Set the homepage in the User Templates

     -username       Set the homepage only for this user
     -ffmstone       Specify the milestone version for FireFox

     -mozmstone          Specify the milestone version for Mozilla (Netscape)

     -removeDownloadLocation Remove the default download location

      -skipIE        Do not set the homepage for Internet Explorer

     -skipFirefox        Do not set the homepage for Firefox

     -skipMozilla        Do not set the homepage for Mozilla based browsers (Netscape)

     -skipSafari         Do not set the homepage for Safari

ShaunRMiller83
Contributor III

It's been a while but the way I have handled this in the past was to do a custom config profile.

The steps I took were:
Updating the homepage on an admin system, copy the com.Apple.Safari user preference. Modify the plist to only include the sections in the plist you wanted to put in my config in this case the homepage. Save the modified plist
Bring the plist into a custom config profile into the JSS. Scope and Test

jmercier
Contributor II

@joshuasee

Thanks... i tried it... works on local account but does not seems to be working on AD network accounts... weird...

ill check more into this

Hugonaut
Valued Contributor II

@jmercier use composer

snapshot before and after

change safari homepage address

create the package source,

remove everything that is unnecessary besides where the homepage was changed

Save the package, and push out the package..quick easy, no heavy lifting!

________________
Looking for a Jamf Managed Service Provider? Look no further than Rocketman
________________


Virtual MacAdmins Monthly Meetup - First Friday, Every Month

ScottVV
Release Candidate Programs Tester

Chrome and Safari can be controlled by a configuration profile. It'll have to be a custom configuration profile though. Firefox can be controlled by an autoconfig.js file. Here are some links about Firefox and Chrome that you may find helpful:
Deploying Chrome profiles and a list of Chrome settings.
Deploying Firefox and a list of FireFox aboutconfig entries.

CHROME:
So in order to change/set the homepage for chrome you’ll want to follow these steps:
1. Open terminal and type the following commands:

defaults write ~/Desktop/com.google.Chrome.plist HomepageLocation -string "www.YourHomepage.com"
defaults write ~/Desktop/com.google.Chrome.plist RestoreOnStartupURLs -array -string "www.YourHomepage.com"
defaults write ~/Desktop/com.google.Chrome.plist NewTabPageLocation -string "www.YourHomepage.com"

What this will do is set your homepage, the page that shows when Chrome starts, and the page that shows when new tabs open, to www.YourHomepage.com.

  1. After you’ve typed in your defaults commands run
    plutil -convert xml1 “~/Desktop/com.google.Chrome.plist”
  2. Go to the JSS/Jamf Pro and go to Computers > Configuration Profiles and create a new profile.
  3. In the new config profile scroll down to custom settings and click configure.
  4. Click the Upload Property File List and navigate to the com.google.chrome.plist you created.
  5. You should see all the settings you set in step 1 upload to the JSS/Jamf Pro.

SAFARI:
Follow the exact same steps as Chrome except for the defaults commands use just this one command.

defaults write ~/Desktop/com.apple.Safari.plist HomePage -string "www.YourHomepage.com"

FIREFOX:
1. Open a text editor an paste the following into it:

// Any comment. You must start the file with a comment!
// Set default homepage and prevent changing
lockPref("browser.startup.homepage", "www.YourHomepage.com");

2. Save the file as MyConfig.cfg. The name can be what ever you want just end it in .cfg
3. Now create a new file and put the following into it:

// Any comment. You must start the file with a single-line comment!
pref("general.config.filename" , "MyConfig.cfg");
pref("general.config.obscure_value", 0);

4. Save the file as autoconfig.js. The file MUST be named autoconfig.js
5. Copy the autoconfig.js to “/Applications/Firefox.app/Contents/Resources/defaults/pref”
6. Copy the MyConfig.cfg file to “/Applications/Firefox.app/Contents/Resources”
7. Package those to files up and deploy them. How you want to do that is up to you. You can script it in a pkg, or you can create a dmg with just those files in the location.

jmercier
Contributor II

thanks to all...

i must be doing something not good... none of the solutions works....

the page is just not changing....

easyedc
Valued Contributor II

Silly question @jmercier, but are you using a config profile to push this change out? If so, are you using a user-level profile? The custom payload profile should work for you. Out of curiosity, what OS?

jmercier
Contributor II

@easyedc

tried terminal, remote desktop, JAMF... config profile yes...

using computer level...

10.11-10.12-10.13

ScottVV
Release Candidate Programs Tester

@jmercier

It looks like I had a wrong command in one of the Chrome defaults commands. The third defaults command for Chrome should be:

defaults write ~/Desktop/com.google.Chrome.plist NewTabPageLocation -string "www.YourHomepage.com"

I took out the "-array" in the command which was a typo on my part. Sorry about that. If that doesn't fix the issue than can you post a screen shot of the Custom Settings in your config profile.

jmercier
Contributor II

@ScottVV

hi

i am trying only on safari for now

ScottVV
Release Candidate Programs Tester

@jmercier

Can you attach a screen shot of the Config profile you are using for Safari?

jmercier
Contributor II

@ScottVV

there you go i think this is what you want

The only thing it does is that it makes 2 field in safari greyed out, and the default home page is not changing at all

{WebKitRespectStandardStyleKeyEquivalents=true, LastOSVersionSafariWasLaunchedOn=10.13.3, SuccessfulLaunchTimestamp=5.3927526E8, LastExtensionMessageTraceTime=5.3927475E8, com.apple.Safari.ContentPageGroupIdentifier.WebKit2ApplePayEnabled=true, AutoplayQuirksWhitelistConfigurationUpdateDate=Fri Feb 02 14:32:38 EST 2018, WebsitesKnownToUsePluginsConfigurationUpdateDateKey=Fri Feb 02 14:32:23 EST 2018, NSToolbar Configuration BrowserToolbarIdentifier-v2={TB Icon Size Mode=1, TB Size Mode=1, TB Display Mode=2, TB Is Shown=1}, UserStyleSheetEnabled=false, NSPreferencesContentSize={906, 431}, SearchProvidersNotAllowedToPromptToBeMadeDefault={}, cloudKitBookmarksMigrationRampState={dateOfLastSettingsUpdate=Fri Feb 02 14:32:24 EST 2018, rampIncludesUserIdentity=true, settingsDictionary={minimumMacSafariVersion=604.4, operatingSystemVersionRanges=[{minimumVersion=11.2, family=iOS}, {minimumVersion=10.12.6, maximumVersion=10.13, family=OSX}, {minimumVersion=10.13.2, family=OSX}], gmMigrationPercent=1000, internalMigrationPercent=1000, seedMigrationPercent=1000}, userIdentity=_9a2d9b72de32027c585993e81551e620}, DidReportHistorySettings=true, NSWindow Frame BrowserWindowFrame=292 86 1324 940 0 0 1920 1057 , RecentWebSearches=[], ManagedPlugInPolicies={com.microsoft.SilverlightPlugin={PlugInDisallowPromptBeforeUseDialog=true, PlugInFirstVisitPolicy=PlugInPolicyBlock}, com.microsoft.sharepoint.browserplugin={PlugInFirstVisitPolicy=PlugInPolicyAsk}, com.adobe.director.shockwave.pluginshim={PlugInFirstVisitPolicy=PlugInPolicyAsk}, com.microsoft.skypeforbusiness.plugin-16.2={PlugInFirstVisitPolicy=PlugInPolicyAsk}, com.microsoft.SkypeForBusiness.MeetingJoinPlugin={PlugInFirstVisitPolicy=PlugInPolicyAsk}, com.oracle.java.JavaAppletPlugin={PlugInFirstVisitPolicy=PlugInPolicyBlock}, com.adobe.acrobat.pdfviewerNPAPI={PlugInFirstVisitPolicy=PlugInPolicyAsk}, com.macromedia.Flash Player.plugin={PlugInDisallowPromptBeforeUseDialog=true, PlugInFirstVisitPolicy=PlugInPolicyBlock}} , OpenWindows=[BrowserWindowController], AutoplayPolicyWhitelistConfigurationUpdateDate=Fri Feb 02 14:32:38 EST 2018, FaviconDatabaseDidEraseLegacyDatabase=true, NewWindowBehavior=0, DidUnsubscribeFromRSSFeeds=true, StartPageViewControllerMode=0, SearchProviderIdentifierMigratedToSystemPreference=true, com.apple.Safari.ContentPageGroupIdentifier.WebKit2InvisibleAutoplayNotPermitted=true, com.apple.Safari.ContentPageGroupIdentifier.WebKit2NeedsStorageAccessFromFileURLsQuirk=false, DidMigrateTabsToLinksForReaderKey=true, NewTabBehavior=0, DidMigrateWebKit1Preferences=true, DidMigrateToCoreSpotlightBasedHistorySearch=true, SkipLoadingExtensionsAtLaunch=true, com.apple.Safari.ContentPageGroupIdentifier.WebKit2MediaDevicesEnabled=true, ShowSidebarInTopSites=false, DidMigrateToMoreRestrictiveFileURLPolicy=true, DidMigrateDisabledPlugInsInfoToAllPlugInsInfo=true, NSToolbar Configuration NSPreferences={TB Icon Size Mode=1, TB Size Mode=1, TB Display Mode=1, TB Is Shown=1}, ExtensionsEnabled=true, com.apple.Safari.ContentPageGroupIdentifier.WebKit2HiddenPageDOMTimerThrottlingAutoIncreases=true, NSWindow Frame Preferences=507 492 906 453 0 0 1920 1057 , DefaultBrowserPromptingState2=4, DidDisableIndividualExtensionsAfterRemovingOnOffSwitchIfNecessary=true, com.apple.Safari.ContentPageGroupIdentifier.WebKit2ShouldSuppressTextInputFromEditingDuringProvisionalNavigation=true, DidMigrateNewBookmarkSheetToReadingListDefault=true, UniversalSearchFeatureNotificationHasBeenDisplayed=true, com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsPictureInPictureMediaPlayback=true, DidMigrateStartPageDefaultSidebarVisibility=true, PlugInInfo={com.microsoft.SilverlightPlugin={plugInCurrentState=false, plugInStateModifiedDate=Fri Feb 02 14:32:23 EST 2018, plugInStateModifiedVersionString=5.1.41212.0}, com.microsoft.sharepoint.browserplugin={plugInCurrentState=true, plugInStateModifiedDate=Fri Feb 02 14:32:23 EST 2018, plugInStateModifiedVersionString=15.32.17030901}, com.adobe.director.shockwave.pluginshim={plugInCurrentState=true, plugInStateModifiedDate=Fri Feb 02 14:32:23 EST 2018, plugInStateModifiedVersionString=12.2.5r195}, com.microsoft.skypeforbusiness.plugin-16.2={plugInCurrentState=true, plugInStateModifiedDate=Fri Feb 02 14:32:23 EST 2018, plugInStateModifiedVersionString=16.2.0.184}, com.microsoft.SkypeForBusiness.MeetingJoinPlugin={plugInCurrentState=true, plugInStateModifiedDate=Fri Feb 02 14:32:23 EST 2018, plugInStateModifiedVersionString=1}, com.oracle.java.JavaAppletPlugin={plugInCurrentState=false, plugInStateModifiedDate=Fri Feb 02 14:32:23 EST 2018, plugInStateModifiedVersionString=1.8.121.13}, com.adobe.acrobat.pdfviewerNPAPI={plugInCurrentState=true, plugInStateModifiedDate=Fri Feb 02 14:32:23 EST 2018, plugInStateModifiedVersionString=15.023.20053}, com.macromedia.Flash Player.plugin={plugInCurrentState=false, plugInStateModifiedDate=Fri Feb 02 14:32:23 EST 2018, plugInStateModifiedVersionString=27.0.0.180}} , Homepage=http://www.collegeahuntsic.qc.ca/je-suis/employe, DidClearLegacySpotlightMetadataCaches=true, LastSharedLinksMessageTraceTime=5.3927341E8, LocalFileRestrictionsEnabled=true, NewestLaunchedSafariVersion=604.5.6, FrequentlyVisitedSitesCache=[{Title=Facebook, URL=https://www.facebook.com/}, {Title=Toutes les Nouvelles du Sport: Infos, Vidéos, Résultats & Statistiques - TVA Sports, URL=http://www.tvasports.ca/}, {Title=Apple (France), URL=https://www.apple.com/fr/}], NSPreferencesSelectedIndex=0, LastApplicationCacheMessageTraceTime=5.3927475E8, LastCloudHistoryConfigurationUpdateTime=Fri Feb 02 14:32:24 EST 2018}

ScottVV
Release Candidate Programs Tester

@jmercier Yeah that's what I was looking for. It looks like you uploaded the entire Safari plist to the the JSS. For custom settings profiles you'll just want the keys you are managing in the plist. So you'd create a new com.apple.Safari.plist and it would only have just the HomePage key in it.

Here is what the com.apple.Safari.plist looks like for our Safari environment. 11685e772d4a4e6b9ba879f93d932b30

and here's what it looks like uploaded to the JSS.
86f019a28a20442e8f79bd581c31e628

jmercier
Contributor II

@ScottVV

and with that simple PLIST you are able to change the home page for current user even on sierra without any trouble ?

ill give that a try in a few minutes

jmercier
Contributor II

@ScottVV

Tried your solution and same thing... homepage not changing

ScottVV
Release Candidate Programs Tester

@jmercier

Can you check and see if your homepage key is "HomePage" and not "Homepage". It looked like "Homepage" in your previous config profile.

Also is your distribution method install automatically and set to computer level?

jmercier
Contributor II

@ScottVV

i thing your an all star... HomePage was there the first try that did not work... but then i made a mistake writing it when i deleted all the keys like you said...

seems to be working now...

thanks a lot

ScottVV
Release Candidate Programs Tester

@jmercier

Glad to hear it's working. If you need any help with Chrome and/or Firefox feel free to ask.

RLim945
New Contributor III

Is there a way we can replace the com.apple.Safari.plist file instead of creating a Configuration Profile out of it? Possibly in a script so that no packages need to be uploaded? We'd like our users to have the option to change the homepage.

cdinsight
New Contributor II

Hi everyone,

This worked on the latest build of Chrome. Variable available at:
http://www.chromium.org/administrators/policy-list-3#HomepageLocation

Plist settings:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict> <key>HomepageIsNewTabPage</key> <false/> <key>HomepageLocation</key> <string>inside.insight.com</string> <key>RestoreOnStartup</key> <integer>4</integer> <key>RestoreOnStartupURLs</key> <array> <string>inside.insight.com</string> </array> <key>ShowHomeButton</key> <true/>
</dict>
</plist>

jamfnc
New Contributor III

Posted: 3/2/18 at 4:20 AM by ScottVV
- The Firefox Home page works perfectly. Thks

KMak84
Contributor

@ScottVV I know this is an old post but was wondering if you could assist.

Followed the chrome steps worked fine.

Safari, it does not open the desired URL that I wanted. Pushed to a machine via config profile, when checking the plist in this location on a 10.14 /Users/$USER/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist I can see the Homepage to the url that I want but still nothing.

In FireFox again followed the steps placed the files as a test locally to that machine still no joy, any tips to get it working on Safari and Firefox?

Thanks

ScottVV
Release Candidate Programs Tester

Hey @k84 , sure I can help. Can you post a screen shot of what your config profile for Safari looks like in Jamf Pro? Also can you post the contents of the .cfg file you are using for Firefox?

KMak84
Contributor

@ScottVV sorry for the late reply, but here is the attachment.
It is basically the Corporate Intranet site. It is now working on FireFox but still not on Safari.
The configuration Profile is set to Install Automatically & on Computer Level

Thanks

79825e5063cb496893d6e16310b12dcd

ScottVV
Release Candidate Programs Tester

@k84 Thanks for posting the plist. The issue is probably that you uploaded the entire plist instead of just the entry or entries you want to manage. Take a look at my post above. Those are the settings we use in our student environment.

If you just want to manage the Homepage this command will create the plist with the setting you want on your desktop. Make sure to capitalize the "P" in "HomePage "

defaults write "~/Desktop/com.apple.Safari" HomePage -string "www.YourHomePage.com"

Once the plist is created on your desktop convert it to XML, using the command below, and the uploaded it to Jamf.

plutil -convert xml "~/Desktop/com.apple.Safari.plist"

Let me know if that doesn't work or if you have any more questions.

kamahmed
New Contributor II

@ScottVV just re-did it again still nothing

Anything else I can try?

1fcbd1ce365b4d188207b6c05c491a69

kamahmed
New Contributor II

@ScottVV managed to figure it out

Upon checking Safari preferences, it was set to 'New Windows open with: favourites'
But the homepage was there.

So I ran the following in terminal "defaults write ~/Desktop/com.apple.Safari NewWindowBehavior -int 0"
Then plutil -convert xml1 ~/Desktop/com.apple.Safari.plist

Uploaded into Jamf, tested on 2 machines and its all good

Thanks for all your help and reaching out to me

woodsb
Contributor

Check out my post here.