Hey folks,
I have a weird one. We use dockutil to manage Dock.
Dockutil installation + sorting out the Dock is set as a policy after enrollment.
Policy deploys fine, installs Dockutil, adds the required icons but doesn't remove any of them with error 'Remove failed for xxx in /User/Username/Library/Preferences/com.apple.dock.plist'. Although, same script is added to our SelfService and when its run from there, it works as a charm.
#!/bin/bash
echo "running dockutil"
DOCKUTIL=/usr/local/bin/dockutil
$DOCKUTIL --remove 'Safari' --allhomes
$DOCKUTIL --remove 'Mail' --allhomes
$DOCKUTIL --remove 'Contacts' --allhomes
$DOCKUTIL --remove 'Calendar' --allhomes
$DOCKUTIL --remove 'Photos' --allhomes
$DOCKUTIL --remove 'Messages' --allhomes
$DOCKUTIL --remove 'FaceTime' --allhomes
$DOCKUTIL --remove 'iTunes' --allhomes
$DOCKUTIL --remove 'iBooks' --allhomes
$DOCKUTIL --remove 'Maps' --allhomes
$DOCKUTIL --remove 'TV' --allhomes
$DOCKUTIL --remove 'Music' --allhomes
$DOCKUTIL --remove 'Podcasts' --allhomes
$DOCKUTIL --remove 'Freeform' --allhomes
$DOCKUTIL --remove 'App Store' --allhomes
apps=(
"/Applications/Slack.app"
"/Applications/1Password.app"
"/Applications/Quip.app"
"/Applications/Clockify Desktop.app"
"/Applications/Self Service.app"
"/Applications/Privileges.app"
)
for app in "${apps[@]}"; do
$DOCKUTIL --add "$app" --no-restart --allhomes
sleep 2
done
killall Dock
exit 0
Any idea what could be the problem here?
Thanks a lot.