Posted on 03-06-2015 12:44 AM
Has anyone had any luck managing these settings with configuration profiles?
I'm attempting to manage the Finder setting "Calculate All Sizes", in order to globally turn it off on OS X clients.
I'm having success when attempting to manage more standard Finder settings (such as show hard disks on desktop etc.) but not when trying to manage these view settings (nothing seems to apply). Is this even possible to reliably enforce?
I'm using mcxtoprofile to create the configuration profile from the above plist.
Should com.apple.finder preferences be applied at computer or user level? And should it be once, often, or always?
I've tried various combinations with no success. This is on Yosemite clients (though it would be great if it also worked on earlier OSes).
Many thanks for any tips/advice.
Posted on 03-06-2015 08:25 AM
I would think you'd want to set it to User level. Once = set it once and let the user change, Always = user can't change.
Are these local users or users from AD/another directory service? There have been some issues with managed prefs not applying to users from a directory system:
https://jamfnation.jamfsoftware.com/discussion.html?id=12364
Posted on 03-06-2015 08:44 AM
Thanks Robert. Unfortunately that still doesn't work. The standard "Show hard drives on desktop" etc. preferences work (as can be seen at the top of my first screen shot), but not the "calculate all sizes" settings (as at the bottom of the first screen shot).
These are AD user accounts with mobile accounts. Perhaps it's a Yosemite bug as per the thread you referenced.
Posted on 03-06-2015 09:11 AM
What if you script the changes with defaults write?
As a test, log in as one of the AD/mobile account users and run the script, then killall cfprefsd (if not in the script) and check the preference setting.
Could always have a script/launchd combo which runs at user login and sets the values... could add logic so it checks for the presence of a file and only runs once (Once), or checks the values and resets them if changed (Always)...
Posted on 03-09-2015 09:31 AM
Thanks. Good idea, but I'm not sure you can use defaults write to edit nested keys within a plist file..
And Plistbuddy is no longer reliable due to the way OS X now caches (and overwrites) it's preferences.
I even attempted the below Applescript out of desperation but unfortunately it just screws up the plist file and leaves it empty and broken:
tell application "System Events" set finderPrefsFile to property list file "/Users/myname/Library/Preferences/com.apple.Finder.plist" tell finderPrefsFile tell property list item "StandardViewSettings" tell property list item "ListViewSettings" set value of property list item "calculateAllSizes" to NO end tell end tell end tell end tell
I'd be fascinated to know if anyone out there is actually successfully managing these view preferences using any method whatsoever (other than having a correctly formatted .plist in a default profile prior to the user profile being created).
It's a real shame that the config profile method doesn't seem to work.
Posted on 03-09-2015 12:20 PM
@benshawuk you might want to look at a bash script that sets the values via the defaults command.
Or, maybe setup the plist as you want & create a custom configuration profile from the JSS. That may either enforce the settings, or set them once per login.
Posted on 03-11-2015 04:02 AM
Thanks Bentoms, but the problem is "defaults write" isn't suited to editing subkeys of plist files.
I think this is why plistbuddy has been so popular up until the new method of OS X caching preferences with cfprefsd etc. (which now renders it useless for modifying "live" plists such as com.apple.finder)
Replacing the com.apple.finder.plist file is probably the way to go, however this is problematic in how inflexible it is: Any user modifications to the finder: icon sizes, text size, view settings etc. will be completely overwritten.
I'm amazed at how impossible this simple management requirement actually is.
If anyone else has any other suggestions, I'm all ears...
Posted on 03-11-2015 05:41 AM
Wow, just discovered your article here that might provide an answer my question:
https://macmule.com/2014/02/07/mavericks-preference-caching/
Is the Python method the best here?
Or do you know if the "defaults read" after plistbuddy modifying works reliably? (as mentioned in the comments below the article)
It certainly feels uncomfortable to killall cfprefsd as a "solution"..
Posted on 08-04-2015 12:44 PM
@benshawuk Any luck getting calculate all sizes managed in Finder? Trying to figure out what the best way to do this would be.
Posted on 08-05-2015 12:59 AM
Hi Andrew,
It was a bit of a kludge to be honest, but this seemed to work eventually.
The script needs to be applied at user/GUI level (not root in the background) periodically, whilst the user is logged in. (I don't actually use Casper so I'm not exactly sure how this is done within the Jamf environment):
cuser=$(#however you prefer to get the current user/home info#)
/usr/libexec/PlistBuddy "/Users/$cuser/Library/Preferences/com.apple.finder.plist" -c 'Delete "StandardViewSettings:ExtendedListViewSettings:calculateAllSizes" bool'
/usr/libexec/PlistBuddy "/Users/$cuser/Library/Preferences/com.apple.finder.plist" -c 'Delete "StandardViewSettings:ListViewSettings:calculateAllSizes" bool'
/usr/libexec/PlistBuddy "/Users/$cuser/Library/Preferences/com.apple.finder.plist" -c 'Delete "SearchViewSettings:ExtendedListViewSettings:calculateAllSizes" bool'
/usr/libexec/PlistBuddy "/Users/$cuser/Library/Preferences/com.apple.finder.plist" -c 'Delete "SearchViewSettings:ListViewSettings:calculateAllSizes" bool'
/usr/libexec/PlistBuddy "/Users/$cuser/Library/Preferences/com.apple.finder.plist" -c 'Delete "ComputerViewSettings:ListViewSettings:calculateAllSizes" bool'
/usr/libexec/PlistBuddy "/Users/$cuser/Library/Preferences/com.apple.finder.plist" -c 'Delete "ComputerViewSettings:ExtendedListViewSettings:calculateAllSizes" bool';
exit 0; fi
/usr/libexec/PlistBuddy "/Users/$cuser/Library/Preferences/com.apple.finder.plist" -c 'Delete "FK_StandardViewSettings:ListViewSettings:calculateAllSizes" bool'
/usr/libexec/PlistBuddy "/Users/$cuser/Library/Preferences/com.apple.finder.plist" -c 'Delete "FK_StandardViewSettings:ExtendedListViewSettings:calculateAllSizes" bool'
/usr/libexec/PlistBuddy "/Users/$cuser/Library/Preferences/com.apple.finder.plist" -c 'Add "FK_StandardViewSettings:ListViewSettings:calculateAllSizes" bool false'
/usr/libexec/PlistBuddy "/Users/$cuser/Library/Preferences/com.apple.finder.plist" -c 'Add "FK_StandardViewSettings:ExtendedListViewSettings:calculateAllSizes" bool false'
/usr/libexec/PlistBuddy "/Users/$cuser/Library/Preferences/com.apple.finder.plist" -c 'Delete "StandardViewSettings:ExtendedListViewSettings:calculateAllSizes" bool'
/usr/libexec/PlistBuddy "/Users/$cuser/Library/Preferences/com.apple.finder.plist" -c 'Delete "StandardViewSettings:ListViewSettings:calculateAllSizes" bool'
/usr/libexec/PlistBuddy "/Users/$cuser/Library/Preferences/com.apple.finder.plist" -c 'Delete "SearchViewSettings:ExtendedListViewSettings:calculateAllSizes" bool'
/usr/libexec/PlistBuddy "/Users/$cuser/Library/Preferences/com.apple.finder.plist" -c 'Delete "SearchViewSettings:ListViewSettings:calculateAllSizes" bool'
/usr/libexec/PlistBuddy "/Users/$cuser/Library/Preferences/com.apple.finder.plist" -c 'Delete "ComputerViewSettings:ListViewSettings:calculateAllSizes" bool'
/usr/libexec/PlistBuddy "/Users/$cuser/Library/Preferences/com.apple.finder.plist" -c 'Delete "ComputerViewSettings:ExtendedListViewSettings:calculateAllSizes" bool'
You may want to take steps to back up the original file first too:
if [ ! -f /Users/$cuser/Library/Preferences/com.apple.finder.plist.backup ]; then
echo "Finder plist backup not found. Creating..."
cp /Users/$cuser/Library/Preferences/com.apple.finder.plist /Users/$cuser/Library/Preferences/com.apple.finder.plist.backup
else echo "Finder plist already backed up."
fi
Good luck. Shame Apple make these sort of things such a PIA to manage.
My next fun task is always showing the computer object in the "devices" menu of the sidebar... :(