Posted on 04-29-2019 12:38 PM
I'm hoping that someone can confirm what I'm seeing. We were hoping to set the safari homepage on our macs through Jamf Pro. But it appears that in Mojave (earlier?), Safari has been containerized so the plist that has the homepage is now under /users/*/library/containers/.... There doesn't appear to be anyway to modify the setting(not via script or configuration profile) unless you turn off SIP first. Is that correct? Or is there something I'm missing?
Posted on 07-15-2022 12:01 PM
I believe the script stopped working since the elimination of Python 2 in (I believe) 12.3.
07-19-2022 08:20 AM - edited 07-19-2022 08:21 AM
Forgot to post this since that change:
#!/bin/bash
HomePage='http://jamfnation.com'
CurrentUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }' )
# Set Safari Homepage com.apple.Safari
defaults write /Users/$CurrentUser/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist HomePage -string $HomePage
defaults write /Users/$CurrentUser/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist NewWindowBehavior -int 0
defaults write /Users/$CurrentUser/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist NewTabBehavior -int 0
chown $CurrentUser /Users/$CurrentUser/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist
# Flush Preference Cache
killall cfprefsd
Posted on 07-18-2022 09:02 AM
Changing the CurrentUser variable to
CurrentUser=`stat -f "%Su" /dev/console`
fixed the issue