Created
June 29, 2026 13:12
-
-
Save 4np/83ea790132d54acbfe8845542e67e615 to your computer and use it in GitHub Desktop.
Stay part of the macOS / Active Directory admin group.
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
| # Add this cronjob for root (e.g. see sudo crontab -l) and replace user.name with the actual username | |
| # of the user that should retain admin membership). Whenever the admin membership is revoked the the | |
| # user, this cronjob will re-add the user to the admin group. | |
| # | |
| # This runs every second; tweak the trigger moment if needed. | |
| * * * * * dscl . -read /Groups/admin GroupMembership|grep -vq "user.name" && dscl . -merge /Groups/admin GroupMembership "user.name" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment