Best way to add dock items for all users

chrisw
New Contributor

We are trying to add Office dock items to all users. A policy is created and it runs but the dock items are not appearing for all users. The policy is triggered at startup and runs one per computer. When I change to user and run at login, it runs just fine and the dock items appear. But this way seems not very efficient.

17 REPLIES 17

mm2270
Legendary Contributor III

Just curious, but why are you using the startup trigger for this? I think that might be the issue. I don't think something like dock items can be deployed that way. Try just using the every15 trigger instead. That should work, but the one issue is that logged in user's will see their Dock restart momentarily as it adds the items in.

SeanA
Contributor III

When you say "when I change to user and run at login", I assume you are talking about changing the policy's frequency to "once per user" and "login".

Running a policy "once per computer" only runs it for that current user, then goes away. Unless that policy is sending data to "fill user templates", "fill existing user home directories", and/or somehow affecting the English.lproj directory, then it will only apply to that current user. In my experience, adding dock items via the Casper Admin method will only affect the current user using the "once per computer" frequency.

chrisw
New Contributor

ok. Thank you. Applying the policy per computer then it goes away makes sence. I thought it would apply to any user who logs in not only the current user. The policy has been modified to run every 15 minutes with a frequency of "once per user". I will see what happens now.

mm2270
Legendary Contributor III

That should help, but just be aware of an issue with the "once per user" setting. See this Feature Request for the low-down:
https://jamfnation.jamfsoftware.com/featureRequest.html?id=45

The gist is, it acts as once per user across all managed computers. Meaning, if user "johndoe" logs into ComputerA, the policy will run for his account on that Mac that one time. If "johndoe" then logs into ComputerB., the policy will not run, even though it may be the first time he's logging into ComputerB, because the JSS sees that the policy already ran for that account, just on a different Mac. In 1:1 type environments, this isn't usually an issue, but it may be for you if you have users jumping around on different Macs.

SeanA
Contributor III

mm2270,
Ooo, nasty! Thanks for the clarification.

mm2270
Legendary Contributor III

Yes, I believe this is a "working as expected" issue though, not a bug. If you think it makes sense for a policy set to once per user to run for any user the first time they log in on any Mac & any additional Macs, I'd vote up the Feature Request.

chrisw
New Contributor

Thank you all for responding. I posted this the JAMF Support and they responded below. For now, I am doing policy at user login.

*The dock.plist is stored at User's Library/Preferences/com.apple.dock.plist. The fact that it is stored in a user's library explains the reason it has to be applied to each user and why if it is applied at a computer level, it only affects the current user. The plist is user specific so that each user can have an individualized dock.

If we want to use a policy, we can execute the policy at login once per user. Then every user will get the dock item that logs on.

If we want to customize the dock.plist, we could potentially create the desired plist on a testing computer and package the plist by dragging it into Composer. Once packaged we can to deploy the package to all current user templates and future user templates. This is essentially what you are looking to accomplish. However, the bummer of deploying a plist, is that it overwrites any existing plist. So if as a user I have added Chrome to my dock and you deploy a plist without Chrome, I lose my customized dock because I get your desired one. So just be aware of the repercussions of packaging up a customized plist and deploying.
*

barnesaw
Contributor III

I've been using profiles to deploy dock items to 10.7 and 10.8 machines. Make it apply to all users and you have a winner.

donmontalvo
Esteemed Contributor III

Might take a look at dockutil:

https://github.com/kcrawford/dockutil

--
https://donmontalvo.com

endor-moon
Contributor II

There is a file that modifies docks in the system:

/Library/Preferences/com.apple.dockfixup.plist

I'm not sure how/when it is executed, but it can do things like add or remove dock items. Apple uses it to do things like add the App store for each user. Does anyone know how this works?

Cheers...

rmanly
Contributor III

Don has the way of it.

dockutil

always dockutil

:)

tkimpton
Valued Contributor II

Be aware Dockutil on 10.8 is doing weird things like if you kill the dock it removes everything and adds unwanted items. It looks like a new users dock you would get if you bought a mac and just turned it on.

Haven't had time to investigate yet

drowe
New Contributor

Once installed, what do you do to make the items you want in the dock to work, do you need to run a policy?

mm2270
Legendary Contributor III

@drowe, are you talking about the built in JSS function, or using dockutil? Two different things and as such you'll get two entirely different responses, so you may want to clarify what you're looking for.

drowe
New Contributor

i was referring to dockutil and how it works. I am unable to get the JSS Dock feature to work properly and from this thread, looks like a few people prefer DockUtil

mm2270
Legendary Contributor III

If you search specifically on dockutil you should pull up a number of threads with some example scripts.

Generally speaking, you'll want to download dockutil and place it somewhere in a standard PATH location for the shell. An example would be in the same directory as the jamf binary /usr/sbin/
Once there, in Terminal simply do

dockutil --help

And you'll get a manual displayed showing all the available syntax and a good amount of examples of how to use it. Most standard stuff is very easy, though it can be slightly trickier with some items, for example, creating URL dock items that have odd characters in them or spaces.

But for something like adding in, say, Microsoft Word 2011 to the Dock, it would be

dockutil --add /Applications/Microsoft Office 2011/Microsoft Word.app

dockutil has a lot of cool stuff, like replacing existing Dock icons with other ones, placing dock icons in specific positions in the dock (going left to right or top to bottom), positioning Dock icons after or before existing ones in the Dock, and even locating Dock icons already there and listing the position.
Example:

dockutil --find 'Microsoft Word'
Microsoft Word was found in persistent-apps at slot 15 in /Users/username/Library/Preferences/com.apple.dock.plist

You can even add folders in on the right side of the Dock and control the view (Fan, Grid, List)

Hope that helps.

drowe
New Contributor

Thank you...great!