Skip to main content
Jamf Nation, hosted by Jamf, is the largest Apple IT management community in the world. Dialog with your fellow IT professionals, gain insight about Apple device deployments, share best practices and bounce ideas off each other. Join the conversation.

Disabling .DS_store Read

Hi all,

I was wondering if someone could shed some light or recommend an alternative method to execute the below. We have a number of Mac users who access network shares, and we are experiencing performance issues when being accessed by Adobe applications. I found the following article: https://support.apple.com/en-gb/HT208209 which will hopefully will resolve the issue. I have run the actions described in the article and it works if directly entered into terminal from a users account, im now stuck trying to deploy via jamf to the whole estate.

There are 2 parts to the fix, part 1 is to run the command in terminal from the users account to disable reading the .DS_store files created by mac's, the second part which creates a nsmb.conf file. I was able to successfully create the nsmb.conf and deploy to the correct folder directory using the jamf tools. however i am having difficulty executing the first part of the process. using the snapshot tool i was able to see that the file is created and added to the users library preferences rather then the master preferences folder.

I tweak the script to the below to write the com.apple.desktopservices.plist to the users folder, however when i use read command in terminal (defaults read com.apple.desktopservices DSDontWriteNetworkStores) to confirm it executed i get an error to say it domain/pair doesnt exist. If i try to edit the .plist it says incorrect permissions, all other plists in the users folder can be opened, im not sure if this is why its not executing?

My Script:

!/bin/sh

user=ls -l /dev/console | cut -d " " -f 4

defaults write /Users/$user/library/Preferences/com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE

...Thanks in advance for any input

Like Comment
Order by:
SOLVED Posted: by tak10

We are having the issue. We didn't have any issue until the server team upgrade our shares to Microsoft DFS shares. We are still researching but we've installed trial of Acronis File Connect to see if this server application helps increase the performance.

Like
SOLVED Posted: by spalmer

You can also just write it at the System level:

#!/bin/sh

# Prevent creation of .DS_Store files on network volumes
echo "Configuring Finder to not create .DS_Store files on network volumes..." 
defaults write /Library/Preferences/com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE
echo "DSDontWriteNetworkStores (bool): $(defaults read /Library/Preferences/com.apple.desktopservices DSDontWriteNetworkStores)"

This will apply it at the System level for all users. However, if that key is already set at the User level it will override the System level setting.

Like
SOLVED Posted: by donmontalvo

Config Profile, no?

Like
SOLVED Posted: by Smanji

thank you all for your help. i am very grateful

Like
SOLVED Posted: by glaske

Here it is in MobileConfig form:

<?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>PayloadContent</key>
    <array>
        <dict>
            <key>DSDontWriteNetworkStores</key>
            <true/>
            <key>PayloadDisplayName</key>
            <string>Desktop Services</string>
            <key>PayloadIdentifier</key>
            <string>12127A9D-E1E4-4327-8298-D7AA045E5A29.com.apple.desktopservices.B5DE31B1-2890-4929-8B2F-71FC2A106514</string>
            <key>PayloadType</key>
            <string>com.apple.desktopservices</string>
            <key>PayloadUUID</key>
            <string>B5DE31B1-2890-4929-8B2F-71FC2A106514</string>
            <key>PayloadVersion</key>
            <integer>1</integer>
        </dict>
    </array>
    <key>PayloadDisplayName</key>
    <string>Disable .DS_Store on Network Share</string>
    <key>PayloadIdentifier</key>
    <string>12127A9D-E1E4-4327-8298-D7AA045E5A29</string>
    <key>PayloadScope</key>
    <string>System</string>
    <key>PayloadType</key>
    <string>Configuration</string>
    <key>PayloadUUID</key>
    <string>12127A9D-E1E4-4327-8298-D7AA045E5A29</string>
    <key>PayloadVersion</key>
    <integer>1</integer>
</dict>
</plist>

Just quickly generated that - feel free to take/change. Paste it in a text file, add .mobileconfig to the end. Then you can sign it before uploading to Jamf.

Cheers,
Chris

Like