Skip to main content

I am looking to change all of my users System preferences --> General --> set 'Show scroll bars' to 'Always'. I didnt see it in "managed Preferences" so I am wondering how to set this in jamf for my users.

Hi. That gets stored in each user's ~/Library/.GlobalPreferences.plist, in a setting called AppleShowScrollBars set to a string of Always Other options are "Automatic" and "WhenScrolling"



I don't know if that's a built in Configuration Profile option. It doesn't look like it. You can probably create that from a custom plist uploaded to make a Custom Payload for a Profile, but I haven't tried that to see.



Barring that, you could, I suppose, script it. Something like:



/usr/bin/defaults write /Users/$username/Library/.GlobalPreferences.plist AppleShowScrollBars Always
or
/usr/bin/defaults write -currentHost AppleShowScrollBars
For the latter, it would need to be run as the current user, not from root or your service account.



Problem is, I'm not sure if injecting it that way will make it take effect right away. I suspect not until after the Finder is restarted maybe.


@NealIV
I use that line in my 1st boot setup script. You could use outset to run it for users at login


[~ NealIV]
To write into users .GlobalPreferences.plist use



defaults write -globalDomain AppleShowScrollBars -string "What ever you want to set"


From root user:



sudo -u username defaults write -globalDomain AppleShowScrollBars -string "What ever you want to set"


@mm2270
Unfortunately



defaults write -currentHost ...


will write in to ByHost prefs, but not in .GlobalPreferences.plist


Good grief! 😞 You're right @gda. Thanks for pointing out my error. Not only that, but even if it was right, my command above was incomplete to boot as it was missing the Always string.



Impending middle age. That's my excuse.


It wouldn't work when I tried to out it in a policy as a script. It did work locally via terminal.


@NealIV You seem to have missed the whole "from root user" line above from @gda . The command as you have it right now will be affecting the preferences for the root account, not the logged in, or current user.


@mm2270 When I run the "From Root User" as a policy it give me this.


Because "username" is not a real name of the logged in user. Your script needs to first get the logged in username in a variable, and then use that in the defaults command, like this



#!/bin/sh

loggedInUser=$(stat -f%Su /dev/console)

sudo -u $loggedInUser defaults write -globalDomain AppleShowScrollBars -string Always


YMMV with that though. In my experience trying to do sudo -u someuser only works sporadically. There are some more reliable, but more involved methods if that doesn't work for you.



You could also just direct the defaults command right at the user's .GlobalPreferences.plist file instead.



#!/bin/sh

loggedInUser=$(stat -f%Su /dev/console)

defaults write /Users/$loggedInUser/Library/Preferences/.GlobalPreferences.plist AppleShowScrollBars Always

chown $loggedInUser /Users/$loggedInUser/Library/Preferences/.GlobalPreferences.plist


None of the above are tested. I wrote them in directly in the post window, so make sure to test them locally first.


@mm2270 the 2nd script worked! Just had to log out then back in. Thanks!


Can the Global Domain keys be managed by a configuration profile?


Just to let everyone know. This script worked that @mm2270 mm270 recommended. 


#!/bin/sh

loggedInUser=$(stat -f%Su /dev/console)

defaults write /Users/$loggedInUser/Library/Preferences/.GlobalPreferences.plist AppleShowScrollBars Always

chown $loggedInUser /Users/$loggedInUser/Library/Preferences/.GlobalPreferences.plist

Reply