Enables or disables macOS location services based on organizational preferences
This Automox Worklet™ manages location services on macOS endpoints by reading your preferred configuration state and adjusting the system accordingly. The Worklet queries the current location services status through the locationd preference database and compares it against your defined preference setting.
The Worklet uses the locPref variable to control location services state, defaulting to enabled. It applies settings across both the system-level location services configuration and the hardware-UUID-specific configuration to maintain consistent behavior across all user sessions and system services that depend on location data.
Supported on both macOS workstations and servers, this Worklet respects existing endpoint configurations and only takes action when the current state differs from your preference.
Applications with location service access can track where your macOS endpoints are physically located. For mobile endpoints and laptops used by remote workers, this location data reveals employee movements, home addresses, and travel patterns. Malicious applications or compromised software can exfiltrate this sensitive location information to attackers.
Organizations with privacy requirements need granular control over location services. Some environments require location services completely disabled for security reasons, while others need them enabled for specific applications like endpoint tracking or time zone management. This Worklet provides the flexibility to configure location services according to your organization's security policy.
Location data creates compliance risks under GDPR and other privacy regulations that require organizations to protect personal information. Disabling location services when not operationally necessary reduces your organization's exposure to privacy compliance violations and data breach risks.
Evaluation phase: The Worklet queries the current location services state from the locationd preference database at /var/db/locationd/Library/Preferences/ByHost/com.apple.locationd by reading the LocationServicesEnabled value. If the current state matches your configured preference, the Worklet exits with no action needed.
Remediation phase: If the current state differs from the preference, the Worklet writes the new configuration using the defaults command. It updates both the system-level LocationServicesEnabled setting and the hardware-UUID-specific setting to maintain the location services state is consistently applied across all processes and user sessions.
macOS 10.12 or later
Root or administrator privileges to modify locationd preferences
Access to defaults command and system preference database
Optional: Configure locPref variable to 'enabled' or 'disabled' based on your preference (default is 'enabled')
After remediation, location services are either fully enabled or disabled based on your configuration choice. When disabled, all applications lose access to location data and cannot determine the endpoint's physical location. When enabled, location services function according to macOS privacy settings and per-application permissions.
The Worklet confirms the configuration change through its evaluation check. You can verify location services status by checking System Preferences under Security and Privacy or reviewing Worklet execution results in the Automox console.
Run this Worklet on a pilot macOS endpoint and review evaluation output for enable/disable location services.
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 elif, function, eval, then rerun evaluation for compliance.


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