You could use a Policy to edit the Dock, but depending on your deployment it may be ill-advised. Setting a policy, then pushing it out to existing users will overwrite their existing settings. Most users don't respond well to changing how they interact with their computers. If you are planning to deploy to a lab environment then it shouldn't be an issue for you.
In general, though, scripting is a better option. DockUtil is very easy to use:
As @barnesaw mentioned, you would have to script it or use a config profile. I've used dockutil and Dock Master in the past for this. Dockutil is great because you can generate dock items on the fly and edit an already existing dock if you want. I made this script for our different types of systems and it worked pretty well in the past.
Dock master is great because it makes either a PKG or a config profile for your dock. The config profile is immutable, so it's great for things like labs and classrooms.
as @byrnese touched upon, an easy alternative to using any scripting or other tools such as Dock Master or Dockutil is using the built in functionality of JAMF, especially for a base image/initial config.
1. Run JAMF Admin on a vanilla mac with these Dock items present.
2. Add each of the Dock items you want removed from a mac using the ADD DOCK ITEMS. 3. Create a simple policy with a Dock Item payload, but select REMOVE, rather than ADD.
I have this within my build workflow to remove Siri, Mail, iMessage, FaceTime and all other apps not required in the corporate Mac image. Works a treat.
@Just_Jack I followed the process I detailed above --> added the mail app into JAMF Admin using ADD DOCK ITEMS. This then shows as file:///Applicationss/Mail.app/ in JAMF Admin. This is then selectable within the Dock Item Payload to remove - and from my experience - works well.
Where is not working for you ?
Hi @RHJ , I think, there is one slash too much in your path, it should be "file://Applications/Mail.app" intstead of "file:///Applications/Mail.app" :-)
You can add any Object as a Dock-Item. The easiest way is, to locate the Application by using a terminal. Open a terminal on the client, where the Dock-items are. There will be two directories, .../System/Applications/... and .../Applications. some Applications are stored in /System/Applications and some in /Applications.
for example "Mail.app" will be stored in /System/Applications and Safari.App is stored in /Applications.
You have to add the Applications, you want to modify in JamfPro .
After adding the Applications you want (go to "Computer Management, Dock Items, to add them), you are able to modify a user's Dock in different ways.
Notice the dropdown menu when you're adding a Dock Item: there are three options to choose when your are adding a Dock-Item: You can classify the object as "File" as "App" or as "Folder" If you are using a policy, the user will be able to modify the Dock, If you are using a configuration profile, the user is not able to modify the Dock.
I use this way (the build in function of JamfPro) to create a complete new Dock for our users. The only Item, I was not able to delete, was the "System Setting" Item. But this is no matter for us.
Hope, this will help.
I've seen a number of ways that the Dock icons can be pathed in Jamf.
All work for me.
The issue I'm running into is no matter which way I add the dock icon into Jamf Pro and can't get the default icons, like Mail, Facetime, and Calendar, to be removed. I can add icons like MSOffice. Just having a hard time removing icons.
Looks like I might have had corruption in the database?
None of the ideas worked for the dock icons I had for Mail, Contacts, Calendar, etc. I deleted them from Jamf Pro and this time rather than create new ones in Jamf Pro - Computer Management - Dock Items. I created them from Jamf Admin. Using the Add Dock Items. Now The Dock items work. Thanks to all that offered help.
There are differences in file paths depending on the installed OS you're trying to manage. I had to have separate policies scoped to Mojave and Catalina.
If you right click the item in question and select Get Info you'll be able to see the path to the file itself. You could also drag the application icon into a terminal window to be sure.
@NOVELLUS The JAMF Admin method I described in my previous posts uses the three slashes "file:///" whereas it appears when you add it in the JSS you only need to specify two slashes, but based on others posts, they are interoperable, and JAMF handles each correctly regardless. I prefer to use the JAMF admin tool, as it handles all the syntax correctly, and also fills the PLIST location, as per attached, without any need for additional effort/typing. Not sure why you weren't able to remove the SysPrefs from the Dock. This works fine, and I have been using for 2-3 years now to customise new users docks, without issue, when done from the JAMF Admin tool.
@RJH: Your're right, I noticed that behavior last time, when I was working with the Jamf Admin-Tool. I believe, between the second and the third slash, "localhost" will be insert. If you write the path "https://localhost/..." the word "localhost" will be deleted and there are three slashes left.