We use Dockutil under High Sierra to set the Dock when a user logs in. A policy is scoped to All Users, has a Trigger of Login, and a Scope of once per user per computer. The policy runs the script below. I logged in as myself and the Dock was set correctly. I dragged one App off the Dock and one App onto the Dock. I logged off and back on and the Dock was set back to the default. The App I dragged off was now in the Dock and the App I dragged on was not. Any ideas?
!/bin/sh
/usr/local/bin/dockutil --remove all --no-restart /Users/$3
/usr/local/bin/dockutil --add /Applications/Google Chrome.app --position 1 --no-restart /Users/$3
/usr/local/bin/dockutil --add /Applications/Microsoft Word.app --position 2 --no-restart /Users/$3
/usr/local/bin/dockutil --add /Applications/Microsoft Excel.app --position 3 --no-restart /Users/$3
/usr/local/bin/dockutil --add /Applications/Calculator.app --position 4 --no-restart /Users/$3
/usr/local/bin/dockutil --add /Applications/Dashboard.app --position 5 --no-restart /Users/$3
/usr/local/bin/dockutil --add /Applications/Vmware Horizon Client.app --position 6 --no-restart /Users/$3
/usr/local/bin/dockutil --add /Applications/Photos.app --position 7 --no-restart /Users/$3
/usr/local/bin/dockutil --add /Applications/iTunes.app --position 8 /Users/$3