Remotely configuring a user's dock

In a previous discussion [Remotely adding items to a user's dock|http://discussions.apple.com/click.jspa?searchID=5249596&messageID=3327383 ] Dave Sawyer's command to add an application to the Dock failed and the topic was closed and archived.

Here are some commands that worked in ARD's *Send UNIX Command* to replace the entire dock with specific apps and also folders. +Each of the commands consist of one line followed by a return.+ I've broken them up for clarity:

The following two lines delete the current Dock apps and folders; don't use them if you're just adding items to the current Dock

*defaults delete com.apple.dock persistent-apps*
*defaults delete com.apple.dock persistent-others*

• Add Safari
*defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</k ey>*
<string>/Applications/Safari.app</string><key>_CFURLStringType</key>
<integer>0</integer></dict></dict></dict>'

• Add MS Word (note the lack of .app suffix)
*defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</k ey>*
*<string>/Applications/Microsoft Office X/Microsoft Word</string><key>_CFURLStringType</key>*
<integer>0</integer></dict></dict></dict>'

• Add a folder
*defaults write com.apple.dock persistent-others -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</k ey>*
*<string>/Applications (Mac OS 9)/Educational</string>*
<key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>'

• And finally restart the Dock
*killall -HUP Dock*

In ARD I ran the *Send UNIX Command* with +Run command as User: Student+ since that was the user whose Dock was being changed.

One could as well direct the *defaults write* command to /Users/ yourusersname/Library/Preferences/com.apple.dock and run the command as a different user.

G5 iMac, Mac OS X (10.3.x)

Posted on Jan 25, 2008 7:32 PM

Reply
4 replies

Feb 27, 2008 1:08 PM in response to apta

Hey, apta. That's awesome. I usually modify the docks in my lab by copying the com.apple.dock.plist to the client machines (after configuring one the way I want, of course) but this requires a restart before the changes are available.

This looks quite elegant. Seems a little risky for a guy who doesn't know this code though. I do use other Unix commands that I know nothing about (got from this forum before).

Thanks,
Dan

Feb 29, 2008 4:15 PM in response to Dan Gann

Dan- instead of having to restart each client machine after sending them the Dock plist, you can restart the Dock by sending them the Unix command:

*killall -HUP Dock*

By the way, I learn commands by gleaming from other users posts or the ARD Manual and then trying them out on a guinea pig Mac before deploying the rest of the Macs in the lab.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Remotely configuring a user's dock

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.