Need to disable finder preview icons via policy

tomt
Valued Contributor

Hi all,

Ran into an issue where having preview icons active when viewing files
located on an SMB server causes the file to show as locked to an InDesign
plug-in we need to use.

The solution at this point appears to be to disable Show Icon Preview from
the Views preferences. Has anyone ever had to do this via a Casper policy?

Thanks for any pointers,
Tom

-----------------------------------------
Some days you're the bug,
Some days you're the windshield.

8 REPLIES 8

Not applicable

Hi Tom,

Did you ever find a way to do this? We are tracking an issue with Photoshop CS5 that may be related to Icon Previews and need to try to disable via MCX or Casper Policy.

Cheers
Dan

sean
Valued Contributor

Users com.apple.finder.plist file. You'll require the below line changes (as shown by the pipe):

StandardViewOptions = { StandardViewOptions = { ColumnViewOptions = { ColumnViewOptions = { ArrangeBy = dnam; ArrangeBy = dnam; ColumnShowFolderArrow = 1; ColumnShowFolderArrow = 1; ColumnShowIcons = 1; | ColumnShowIcons = 0; ColumnWidth = 269; ColumnWidth = 269; FontSize = 12; FontSize = 12; PreviewDisclosureState = 1; PreviewDisclosureState = 1; SharedArrangeBy = kipl; SharedArrangeBy = kipl; ShowIconThumbnails = 1; | ShowIconThumbnails = 0; ShowPreview = 1; | ShowPreview = 0; }; };

Never done this, but I notice Casper doesn't include this by default, so you'll have to upload a plist or create one manually

Sean

Proactis
New Contributor

Hi,

I've been working on a script to do this for an environment where we had a lot of issues with icon previews creating file locking issues on SMB shares.

After a lot of searching I found this excellent blog which pointed me in the right direction:
http://gumptiontech.co.uk/2015/06/17/disable-mac-10-9-finder-thumbnail-preview-by-command/

I've modified the script from that link to be more useful in Casper. It's working very well for me now!

Neil Broadbent
Proactis Solutions

#!/bin/bash

# Casper PlistBuddy script to disable icon previews and the preview pane for enhanced 
# SMB share compatibility.  Should work with 10.9 through 10.11 (and beyond?)
#
# June 2016 - Neil Broadbent - Proactis Solutions - www.proactis.net
#
#
# This script elaborates on some brilliant work from gumptiontech at the following link:
# http://gumptiontech.co.uk/2015/06/17/disable-mac-10-9-finder-thumbnail-preview-by-command/
#
# I've modified it to run as root and act on the currently logged in user.  Also added 
# additional lines to shut off the preview column in the column finder view, and to 
# disable .DS_Store creation on SMB shares.
#
# This should be run at user login, or by any other means while the target user is logged in.


# Define variables for plistbuddy path, current user, and destination file path
loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`
plistbuddy=/usr/libexec/PlistBuddy
plistfile=/Users/$loggedInUser/Library/Preferences/com.apple.finder.plist

# Delete the existing cover-flow preview setting
$plistbuddy -c 'Delete StandardViewSettings:ExtendedListViewSettings:showIconPreview' $plistfile;

# Delete the existing icon preview setting
$plistbuddy -c 'Delete StandardViewSettings:IconViewSettings:showIconPreview' $plistfile;

# Delete the existing list icon preview setting
$plistbuddy -c 'Delete StandardViewSettings:ListViewSettings:showIconPreview' $plistfile;

# Delete the existing column icon preview setting
$plistbuddy -c 'Delete StandardViewOptions:ColumnViewOptions:ShowIconThumbnails' $plistfile;

# Delete the existing column preview column setting
$plistbuddy -c 'Delete StandardViewOptions:ColumnViewOptions:ColumnShowIcons' $plistfile;

# Reset the cover-flow preview setting to off
$plistbuddy -c 'Add StandardViewSettings:ExtendedListViewSettings:showIconPreview bool false' $plistfile;

# Reset the icon preview setting to off
$plistbuddy -c 'Add StandardViewSettings:IconViewSettings:showIconPreview bool false' $plistfile;

# Reset the list icon preview setting to off
$plistbuddy -c 'Add StandardViewSettings:ListViewSettings:showIconPreview bool false' $plistfile;

# Reset the column icon preview setting to off
$plistbuddy -c 'Add StandardViewOptions:ColumnViewOptions:ShowIconThumbnails bool false' $plistfile;

# Reset the column preview column setting to off
$plistbuddy -c 'Add StandardViewOptions:ColumnViewOptions:ColumnShowIcons bool false' $plistfile;

# Repair ownership on plist file
chown -R "$loggedInUser:staff" $plistfile

# Note that existing .DS_Store files on an SMB share may override these defaults.
# A cleanup of existing .DS_Store files in conjunction with the following lines may 
# yield better results.  Comment the following three lines if undesired.
dsstore=/Users/$loggedInUser/Library/Preferences/com.apple.desktopservices.plist
defaults write $dsstore DSDontWriteNetworkStores true
chown -R "$loggedInUser:staff" /Users/$loggedInUser/Library/Preferences/com.apple.desktopservices.plist

# Delete prefs/plist cache
killall cfprefsd

# Restart the Finder
killall Finder

Proactis
New Contributor

Just a reminder that the above script will set new defaults but that existing .DS_Store files on your drive will undoubtedly already contain some per-directory view options.

The script disables the creation of new .DS_Store files on network shares, but will not clean up existing .DS_Store files. I did the cleanup of .DS_Store files on our windows file server's share with a simple search and delete in explorer.

I also found the following on an Adobe KB article for cleaning up local .DS_Store files on the Macintosh HD:

sudo find / -name ".DS_Store" -depth -exec rm {} ;

As with any bulk deletion: back-up first, use caution, and don't get mad at me if you delete the wrong stuff and wipe out your data :)

-Neil

agerson
New Contributor III

To also set this for the Desktop:

$plistbuddy -c 'Delete DesktopViewSettings:IconViewSettings:showIconPreview' $plistfile;

$plistbuddy -c 'Add DesktopViewSettings:IconViewSettings:showIconPreview bool false' $plistfile;

joseph_kwok
New Contributor

i modified this section to make this work in Mojave

Delete the existing cover-flow preview setting

$plistbuddy -c 'Delete StandardViewSettings:ExtendedListViewSettings:showIconPreview' "$plistfile";

$plistbuddy -c 'Delete ComputerViewSettings:ExtendedListViewSettingsV2:showIconPreview' "$plistfile";

Delete the existing icon preview setting

$plistbuddy -c 'Delete StandardViewSettings:IconViewSettings:showIconPreview' "$plistfile";

Delete the existing list icon preview setting

$plistbuddy -c 'Delete StandardViewSettings:ListViewSettings:showIconPreview' "$plistfile";

$plistbuddy -c 'Delete StandardViewSettings:ExtendedListViewSettingsV2:showIconPreview' "$plistfile";

Delete the existing column icon preview setting

$plistbuddy -c 'Delete StandardViewOptions:ColumnViewOptions:ShowIconThumbnails' "$plistfile";

Delete the existing column preview column setting

$plistbuddy -c 'Delete StandardViewOptions:ColumnViewOptions:ColumnShowIcons' "$plistfile";

Reset the cover-flow preview setting to off

$plistbuddy -c 'Add StandardViewSettings:ExtendedListViewSettings:showIconPreview bool false' "$plistfile";

Reset the icon preview setting to off

$plistbuddy -c 'Add StandardViewSettings:IconViewSettings:showIconPreview bool false' "$plistfile";

Reset the list icon preview setting to off

$plistbuddy -c 'Add StandardViewSettings:ListViewSettings:showIconPreview bool false' "$plistfile";

Reset the column icon preview setting to off

$plistbuddy -c 'Add StandardViewOptions:ColumnViewOptions:ShowIconThumbnails bool false' "$plistfile";

Reset the column preview column setting to off

$plistbuddy -c 'Add StandardViewOptions:ColumnViewOptions:ColumnShowIcons bool false' "$plistfile";

$plistbuddy -c 'Add ComputerViewSettings:ExtendedListViewSettingsV2:showIconPreview bool false' "$plistfile";

$plistbuddy -c 'Add StandardViewSettings:ExtendedListViewSettingsV2:showIconPreview bool false' "$plistfile";

PaynePoint
New Contributor

Could a configuration profile work instead of a Script?

pmcavey
New Contributor II

Anyone done additional work on this, I have been examining a config profile but not gotten anywhere yet.