Fix: user-level MDM artifact cleanup + better volume detection - #177
Open
mateussiqueira wants to merge 1 commit into
Open
Fix: user-level MDM artifact cleanup + better volume detection#177mateussiqueira wants to merge 1 commit into
mateussiqueira wants to merge 1 commit into
Conversation
- Clean user-level MDM artifacts in /Users/*/Library (Preferences, Caches) - Auto-detect Data volume with multiple fallback strategies - Fixes 'Not a known DirStatus' on non-standard volume names - Fixes MDM re-enrollment after reboot due to user-level cache
This was referenced Jun 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two common issues with the current bypass script:
MDM re-enrollment after reboot — The script only removes system-level configuration profiles (
/var/db/ConfigurationProfiles/Settings/.cloudConfig*), but leaves user-level artifacts in/Users/*/Library/(Preferences, Caches). When the user logs in, these artifacts trigger a fresh enrollment attempt."Not a known DirStatus" error — The script assumes the data volume is named exactly "Macintosh HD - Data", but many users have non-standard volume names (custom names during install, macOS upgrades that changed naming, external SSDs with different names).
Changes
Testing
Tested on macOS 26 Tahoe (Apple Silicon M4). After applying these changes, reboot no longer triggers re-enrollment. Volume detection handles 5 different naming patterns.