Skip to content

Instantly share code, notes, and snippets.

@cshepp1211
Last active February 23, 2016 16:48
Show Gist options
  • Save cshepp1211/656f1566cad85e3b0705 to your computer and use it in GitHub Desktop.
Save cshepp1211/656f1566cad85e3b0705 to your computer and use it in GitHub Desktop.
DeleteMCX
#!/bin/bash
# written by Kirk Skaar
#
# v1.1
#
# 19 September 2014
# Script to remove MCX managed preferences
#
# Removes the Managed Preferences directory
# and then deletes mcx from nodes in DS
rm -rf /Library/Managed\ Preferences
dscl localhost -mcxdeleteall /Local/Default/Users
dscl localhost -mcxdeleteall /Local/Default/Groups
dscl localhost -mcxdeleteall /Local/Default/Computers
dscl localhost -mcxdeleteall /Local/Default/ComputerGroups
dscl localhost -mcxdeleteall /Local/Default/ComputerLists
killall cfprefsd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment