I'm trying to find a way to remove all Microsoft Office application (Word, Excel, Outlook, PowerPoint) from the Dock from all users. I've search the net and only really found two different ways of accomplishing this task. 1. Is using a third party app (PlistBuddy) to query the com.apple.dock.plist for Microsoft and remove any occurences. I have not had any success with this option. The second option being using dockutil in order to remove the icons from the dock. I have had success with this only when running locally as root and with the "Accessibility" option enabled in System preferences. (Example of Script Below)
tell application "System Events"
set UI_enabled to UI elements enabled
end tell
if UI_enabled is false then
tell application "System Preferences"
activate
set current pane to pane id "com.apple.preference.universalaccess"
display dialog "This script utilizes the built-in Graphic User Interface Scripting architecture of Mac OS x which is currently disabled." & return & return & "You can activate GUI Scripting by select to checkbox \"Enable access for assitive devices\" in the Universal Access preference pane." with icon 1 buttons {"Cancel"} default button 1
end tell
end if
tell application "Microsoft Word" to quit
tell application "System Events" to tell UI element "Microsoft Word" of list 1 of process "Dock"
if exists then
perform action "AXShowMenu"
click menu item "Options" of menu 1
click menu item "Remove from Dock" of menu 1 of menu item "Options" of menu 1
else
return false
end if
end tell
I repeat the above for each application (Excel / PowerPoint / etc.). However this script needs to be automated and run remotely without requiring the user to enable the accessibility security. Anybody have any ideas??? I've used both bash and applescript to test with no avail on either. I'm using BigFix as the deployment method. Any advise would be appreciated.
Thank you !!