See all filename extensions

mconners
Valued Contributor

I have been working on this all day and cannot find a way to make this work.

We want in our IT lab, to show ALL filename extensions for all users. Essentially, if we use the com.apple.finder.plist for the user template and enable it for one user, it is set for true. However, when we use this as our basis, new users logging in have it set to true, but the filename extensions is still unchecked in Finder preferences. There must be a trigger for this I am simply missing or overlooking.

Has anyone done this successfully?

Thanks for any insights you can offer me.

Mick

8 REPLIES 8

bpavlov
Honored Contributor

Can't confirm in 10.11, but I suspect it still works:
.GlobalPreferences.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>AppleShowAllExtensions</key>
    <true/>
</dict>
</plist>

Convert that PLIST into a mobile config profile either by uploading it to the JSS or using MCXtoProfile.
Or use:

defaults write .GlobalPreferences AppleShowAllExtensions -bool true

Just be careful in what context that defaults command is being run. Obviously you don't want to run it as root. If you need more steps feel free to ask.

mconners
Valued Contributor

Thank you for the quick reply. I have to ask though and excuse me if my ignorance is coming through, you mentioned, "Obviously you don't want to run it as root." Can I ask why? I might know the answer, but I want to make sure I understand it well enough.

bpavlov
Honored Contributor

No worries. The defaults command if run the way I gave it will write specifically to the user's preferences folder. If the user running that command is root which all scripts in the JSS will be executed by root, then that becomes a problem since you want that particular preference written for the particular user you are targeting.

Here's a post where I talk about it a bit more: https://jamfnation.jamfsoftware.com/discussion.html?id=18252#responseChild109162

kaaablume
New Contributor II

I must be missing something as I am trying to apply this exact configuration profile (xml text below) but not having luck. I am testing on 10.11 and 10.12 machines, the profile installs but does not appear to have any affect on the setting in Finder Preferences. After the profile is applied the Finder Preferences box remains unchecked. The 'defaults read NSGlobalDomain AppleShowAllExtenstions' command returns: The domain/default pair of (kCFPreferencesAnyApplication, AppleShowAllExtensions) does not exits. There are no other profiles applied that touch the .GlobalPreferences.plist file.

If I manually check the box in Finder Preferences the same command returns '1' as expected and what I need to accomplish to meet the security requirements. I would really like to enforce this setting with a profile but will have to start looking into a script option.

I feel like I am probably missing something simple so want to check with the Nation. Has anyone been successful enforcing this policy via config profile on 10.11/10.12?

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict> <key>AppleShowAllExtensions</key> <true/>
</dict>
</plist>

yadin
Contributor

Same issue on 10.13.4. Looks like Apple did something to break this setting from working by profile and hasn't fixed it since. I have 6 settings in the GlobalPreferences, but this and the two key repeat rate settings just don't work. Scroll direction, always show scrollbars, and confirm on close settings work fine. No obvious reason of course.

Using the defaults write command is a problem since this is a by user setting from what I've seen, so not sure that would be workable.

Fail different.

gabester
Contributor III

Oh for the good old days when setting AppleShowAllExtensions just worked... Now no Managed Preferences work. Now it can't be properly set with a Config Profile.
What's an admin who wants to display extensions to do? I suppose you can at least apply it via the default profile... anyone placing bets on 10.16 eliminating that as well?
g=

cbd4s
Contributor II

My guess is SIP (System Integrity Protection) introduced from 10.11.6 is stopping us from configuring this either by script or configuration profile.

AdrienPi
New Contributor II

Hey, i make this script to work on Catalina => Ventura, Enable Filename extensions for all users :

#!/bin/bash

user_list=`dscl . -list /Users UniqueID | awk '$2>500 {print$1}'`
ut_path="/Library/User Template/Non_localized/Library/Preferences/.GlobalPreferences.plist"
ut_key=`/usr/bin/defaults read "$ut_path" AppleShowAllExtensions`

for user in $user_list
do
sudo -u "$user" /usr/bin/defaults write NSGlobalDomain AppleShowAllExtensions -bool true && /usr/bin/pkill -u "$user" Finder
echo "$user : Has been modified"
done

if [ -e "$ut_path" ]
then
echo "plist already exist, check key"
if [[ $ut_key == "1" ]];then
echo "Key already exist"
else
/usr/bin/defaults write "$ut_path" AppleShowAllExtensions -bool true
echo "Key added --> OK"
fi
else
echo '<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AppleShowAllExtensions</key>
<true/>
</dict>
</plist>' > "/Library/User Template/Non_localized/Library/Preferences/.GlobalPreferences.plist"
chmod 755 "$ut_path"
echo ".GlobalPreferences created --> OK"
fi