Prevent macOS from creating .DS_Store metadata files on network volumes to reduce information disclosure
This Automox Worklet™ prevents macOS Finder from creating .DS_Store files on network-mounted volumes by setting the DSDontWriteNetworkStores preference to true. DS_Store files contain Finder metadata including view settings, icon positions, and folder attributes.
While these files are invisible by default on Mac systems, they appear as regular files on Windows and Linux systems, cluttering network shares and potentially exposing information about directory contents and user browsing patterns.
apple.desktopservices".
Metadata files can reveal information about folder contents and structure even when the actual files have been deleted, creating information disclosure risks. .DS_Store files can reveal information about folder contents and structure even when the actual files have been deleted. In security-sensitive environments, these metadata files could leak information about confidential directories or project names.
On shared network drives used by Windows and Linux systems, .DS_Store files appear as visible clutter. This creates confusion for non-Mac users and can interfere with scripts or applications that process directory contents.
Web servers that inadvertently serve .DS_Store files have exposed directory structures to attackers. Preventing their creation on network volumes reduces the risk of accidental publication of sensitive metadata.
Evaluation phase: The Worklet reads the DSDontWriteNetworkStores value from /Library/Preferences/com.apple.desktopservices. If the value is not set to true (or 0 in boolean representation), the endpoint is flagged for remediation. Missing or false values indicate that .DS_Store creation is still enabled on network volumes.
Remediation phase: The Worklet uses defaults write to set DSDontWriteNetworkStores to true in the desktopservices preferences. The change takes effect for new Finder sessions and network volume mounts. Existing .DS_Store files on network volumes are not removed.
macOS endpoint (workstation or server)
Administrative privileges for modifying system preferences
Setting applies to SMB, AFP, and NFS network volumes
After running, Finder stops creating new .DS_Store files on network-mounted volumes. Local drives continue to have .DS_Store files created normally, preserving Finder view preferences on the local system. This selective prevention reduces information disclosure on shared network drives while maintaining local functionality.
Existing .DS_Store files on network volumes remain until manually deleted. Users may notice that custom Finder view settings on network folders are not persisted between sessions, as this metadata is no longer stored. This trade-off eliminates the security risk of metadata leakage on network shares.
Run this Worklet on a pilot macOS endpoint and review evaluation output for disable creating .ds_store files on network volumes.
Confirm Automox activity logs show successful completion and exit code 0.
Verify endpoint state using checks aligned to evaluation script logic, such as exit.
Validate remediation effects from script operations such as defaults, else, exit, then rerun evaluation for compliance.
For technical validation, compare endpoint state to the Worklet evaluation logic and remediation flow for disable creating .ds_store files on network volumes. This supports repeatable security workflows, faster change control review, and auditable compliance evidence.
Useful script references for this Worklet include evaluation operations such as exit and remediation operations such as defaults, else, exit. Use these indicators to verify that endpoint changes match intended policy outcomes.


By submitting this form you agree to our Master Services Agreement and Privacy Policy.
Already have an account? Log in
Consider Worklets your easy button
A Worklet is an automation script, written in Bash or PowerShell, designed for seamless execution on endpoints – at scale – within the Automox platform. Worklet automation scripts perform configuration, remediation, and the installation or removal of applications and settings across Windows, macOS, and Linux.

AUTOMOX + WORKLETS™
Uncover new possibilities with simple, powerful automation.
By submitting this form you agree to our Master Services Agreement and Privacy Policy