Managed Preferences - MCX Settings keep appearing from old JSS server

robb1068
Contributor

I'm starting to migrate clients from our old JSS 7.1 to our new JSS 8.4 server and have an odd Managed Preference issue.

On the JSS 7.1 server we had a managed preference for the Dock to always include Safari, Entourage and Self Service. After moving the client over to JSS 8.4, the application icons appear on both sides of the user's Dock (applications and files/folders). After some troubleshooting, I tried disabling the Dock pref on the JSS 8.4, but the client keeps applying the com.apple.dock.plist in the Managed Preferences folder.

I've removed the client from the old 7.1 JSS Inventory
Deleted the /Library/Managed Prefs/ folder
Cleared MCX settings from localhost

In comparing the client to a "clean" install (Imaged to the JSS 8.4 server and not migrated), the migrated client has a /Library/Managed Preferences/com.jamfsoftware.mcx.plist file that the clean install doesn't have. The only data in the com.jamfsoftware.mcx.plist file is <key>version, <string>7.1

Any ideas on where to look? Thanks!

1 ACCEPTED SOLUTION

golbiga
Contributor III
Contributor III

Try these steps.

sudo rm -rf /Library/Managed Preferences
sudo dscl . -delete /Computers/localhost
sudo dcsl . -delete /Users/<username> dsAttrTypeStandard:MCXSettings

Reboot and they should be gone.

Allen

View solution in original post

8 REPLIES 8

golbiga
Contributor III
Contributor III

Try these steps.

sudo rm -rf /Library/Managed Preferences
sudo dscl . -delete /Computers/localhost
sudo dcsl . -delete /Users/<username> dsAttrTypeStandard:MCXSettings

Reboot and they should be gone.

Allen

robb1068
Contributor

Thanks! I was missing the last step to clean the user's MCX settings. Much appreciated!

timcarnegie
New Contributor

Hi Golbiga,
is there a way to apply this to policy to remove it for all users on a machine?
sudo dcsl . -delete /Users/<username> dsAttrTypeStandard:MCXSettings only seems to work when you enter a specific userneme...
sorry i am not much of a command line person.

golbiga
Contributor III
Contributor III

I added this to my firstboot script when upgrading a machine to Mountain Lion. This will re-apply MCX to the computer level and user level. Of course test this in your environment.

Allen

#!/bin/sh 
#Remove MCX Settings
/bin/rm -rf /Library/Managed Preferences/*

# Rebuild computer level MCX
/usr/bin/dscl . -delete /Computers
/usr/sbin/jamf mcx

# Rebuild user level MCX
userNames=`/usr/sbin/jamf listUsers | /usr/bin/grep <name> | /usr/bin/cut -d'<' -f 2 | /usr/bin/cut -d'>' -f 2`
for activeUserName in $userNames; do
    echo "Removing MCXFlags for user $activeUserName"
    /usr/bin/dscl . -delete "/Users/$activeUserName" MCXFlags

    echo "Removing MCXSettings for user $activeUserName"
    /usr/bin/dscl . -delete "/Users/$activeUserName" MCXSettings

    echo "Rebuilding MCX preferences for user $activeUserName"
    /usr/sbin/jamf mcx -username "$activeUserName"
done

sunny_s
New Contributor II

Thanks Golbiga, The script Was pushed by remote policy & worked a treat at clearing old MCX caches which were stored locally.

We use JSS 9.22, the above script was used on a 10.7.5 machine (I presume it would work the same on a 10.8.5 machine too).

matthewbodaly
New Contributor

Thanks. This was exactly what I was looking for. I was already doing the first bit of the script but would occasionally have recurring issues.

dspadmin
New Contributor

Thanks for the script golbiga.

On a side note, it is disappointing of Apple and JAMF that this type of workaround is necessary to get MCX working reliably.

bradtchapman
Valued Contributor II

I would like to add that, for extra thorough cleaning, remove the "MCXFlags" attribute:

dscl . -delete /Users/username dsAttrTypeStandard:MCXFlags

Here's why:

MCXFlags:
 <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>has_mcx_settings</key>
    <true/>
</dict>
</plist>