You have to direct commands like that to a specific plist path. If you just use the domain by itself (com.apple.Safari
), the script will assume it should be affecting the preference of the user running the command, which would be root in most cases when running it from a Jamf policy. That's why it doesn't appear to be working when running it from a policy.
You could fix that by getting the current logged in username and then using a full path to the Safari plist, like
loggedInUser=$(scutil <<< "show State:/Users/ConsoleUser" | awk '/Name
&& ! /loginwindow/ { print $ 3 }')
/usr/bin/defaults write /Users/$loggedInUser/Library/Preferences/com.apple.Safari.plist ShowStatusBar -boolean true
You could also consider using a Configuration Profile to manage this, especially if its something you'd like to enforce. The above command will only set the preference once - the user can easily switch it back off.
Yeah we have been looking into this recently. I tried using a Configuration Profile. It works, but if the end user switch it off it does not restrict or re-apply the "on" setting.

Does this also apply to a way to show the Safari Favorites bar too?
Example: defaults write com.apple.Safari ShowFavoriesBar -boolean true
Can anyone confirm this key/value pair exists for Safari 13/14?
It looks like it’s stored in a ShowFavoritesBar-v2
setting in Safari 14. I’m not sure about Safari 13 but it might be the same.
It’s a Boolean value so either true or false.
Do we have any new solution for Safari v17.3?