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
SOLVED Posted: by stuffelse

@tak10 That's funny, I'm actually here researching deployment of this configuration to finally bail on Acronis. I just had a maintenance window last night to upgrade to Files Connect 10.6.3, based on performance problems we're having connecting to a 2012r2 file server. Granted our shares are pretty big, in the TB range with hundreds of thousands to over a million files, but they enumerate fine from Windows clients, so it's something else.

This summer, we had some performance / utilization problems, they recommended an upgrade, twice, I did both, and then they told me to revert to a super old version because they discovered a memory leak in their application. This version finally fixed that, but didn't resolve the other issues we've had. Being that MacOS defaults to SMB, and they've even declared AFP sharing deprecated, I want to move all the users to SMB connections to at least rule out the third party aspect. This should do the trick.

Like
SOLVED Posted: by stuffelse

Just to follow up here, I found a configuration change that made a very big difference in SMB stability and performance for my users.

Spiceworks post

So the 2012r2 defaults for the SMB2CreditsMax and SMB2CreditsMin settings are 2048 and 128 respectively. I found multiple articles stating that people in similar situations changed those to 8192 and 512 yielded back-to-normal browsing, which we also experienced. (on top of the .ds_store DSDontWriteNetworkStores configuration)

Per Chris1474's post there, I ran the powershell cmdlet: set-smbserverconfiguration -smb2creditsmin 512 -smb2creditsmax 8192

Immediately the enumeration lag, beachballs, and disconnected shares stopped. Anyway, hope this helps others...

Like