This script will delete the default automatically add app store. app icon to the user's dock.
For specific operations, see the script description.
#! /Bin/bash <br/> # events <br/> # removing App Store icon from user's Dock: <br/>#< br/> # Script Name: rmappstoreicon. sh <br/> # copy right: <br/> # copy right 2011 Tony Liu, all Right Reserved. <br/> # Description: <br/> # If you don't want end user to have App Store icon on their dock, this is right for you. <br/> # Why bothe R this? Because most enterprise environment into ies don't like people purchasing <br/> # stuff online, ie app store. <br/> # The system wide dock icon is stored in the plist file: <br/> #/system/library/coreservices/dock. APP/contents/resources/english. lproj/default. plist <br/> # This script needs plistbuddy command line tools installed on your OS, which is supported ded in most <br/> # of Apple packages. it's easy to be found anyway. or pack commands in a installation package. <br/> # You can use the following command to remove it: <br/> # plistbuddy-c "delete: Persistent-apps: 0 "/system/library/coreservices/dock. APP/contents/resources/english. lproj/default. plist <br/> # For newly login users, Dock. APP will put the App Store icon on user's Dock automatically. <br/> # For logged in users, the App Store icon is already sits on their dock. <br/> # To remove for all users, a best practice example likes this: <br/> # removesysappstoreicon <br/> # removealluserappstoreicon <br/> # Another approch: removing the "App Store. APP "from/Applications folder totally. <br/> # For some situation, you may want end users to use it at home, but not in enterprise environment. <br/> # Do the restriction within MCX or Workgroup Manager. <br/> # History: <br/> # initial: tony 2011-06-20 <br/> # ---------------------------------------------------------------------- <br/> # how to use these commands: <br/> # Call removealluserappstoreicon to remove for all users <br/> # Call removeuserappstoreicon username, to remove username user's app store icon. <br/> # Call removesysappstoreicon to remove from system wide. <br/> # callback </P> <p> function removeappstore <br/> {<br/> defaultplist = "$1" <br/> # currentset = 'plistbuddy- C "Print: persistent-apps "$ defaultplist '<br/> # currentset =$ {currentset /////": "} </P> <p> Index = 0 <br/> while [True] <br/> DO <br/> curappicon = 'plistbuddy-c" Print: persistent-apps: $ Index "$ defaultplist '<br/> echo" $ Index "" $ curappicon "<br/> If [-n" $ curappicon "]; then <br/> isappstore = 'echo $ curappicon | grep "App Store" '<br/> If [-n "$ isappstore"]; then <br/> sudo plistbuddy-c "delete: Persistent-apps: $ Index "$ defaultplist <br/> echo" deleted App Store @ $ Index "<br/> Break <br/> else <br/> let Index = index + 1 <br /> fi <br/> else <br/> Break <br/> fi <br/> done <br/>}< br/> function removesysappstoreicon <br/> {< br/> removeappstore "/system/library/coreservices/dock. APP/contents/resources/english. lproj/default. plist "<br/>}< br/> function removeuserappstoreicon <br/>{< br/> removeappstore"/users/$1/library/preferences/COM. apple. dock. plist "<br/>}< br/> function removealluserappstoreicon <br/>{< br/> for auser in 'LS-1/users' <br/> DO <br/> removeuserappstoreicon "$ auser" <br/> done <br/>}< br/> removeappstore "/users/schooladmin/desktop/default. plist "<br/> exit 0
Tony Liu, June 2011
Calgary