Sunday, September 25, 2011

MCX Refresh for Mobile Accounts

I needed to forcibly refresh the per user mcx for a large number of mobile users across many desktop machines under Snow Leopard so I wrote this short script that will do just that.


Can be run from remote desktop (as root), or locally (sudo). It will not always successfully refresh the mcx, but it will force it to be reloaded from the server on the next logon.

Here's the shell script:
 #Brutally refresh mcx for a machine and all mobile accounts on it  #Clear machine cache dscl . -list Computers | grep -v "^localhost$" | while read computer_name ; do sudo dscl . -delete Computers/"$computer_name" ; done echo "Cleared machine MCX cache." #Get a list of locally cached accounts for usr in `dscl . -list /Users AuthenticationAuthority | grep LocalCachedUser | awk '{print $1}' | tr  ...


Add to digg Add to Reddit Add to Slashdot Email this Article Add to StumbleUpon

Source: http://feeds.macosxhints.com/click.phdo?i=a8823646fdc184c2af2b919ae9a16124

apple blog apple hot news apple itablet news imac store news from apple mac computer news applecare apple news rumors

No comments:

Post a Comment