Skip to main content
Question

Adding Server addresses into a policy

  • November 12, 2014
  • 2 replies
  • 15 views

Forum|alt.badge.img+3

Hello All,

I once again turn to the JAMF Nation for some more guidance.

So, on a mac when you hit command K, you can enter in the server address.

Here's my question... is there a way to make this a policy and roll this out to end users? So everyone in the company will have the same server addresses.

Thank You

Darwin

2 replies

scottb
Forum|alt.badge.img+18
  • Valued Contributor
  • November 12, 2014

The info is stored in:

~/Library/Preferences/com.apple.sidebarlists.plist

To read:  defaults read com.apple.sidebarlists favoriteservers
To write: defaults write com.apple.sidebarlists favoriteservers

You could create one with the servers you want and then use a FUT to install in all User's ~/Library/Preferences/ folder.

Or I'm sure a smarter guy/gal will give you a better solution though.


davidacland
Forum|alt.badge.img+18
  • Valued Contributor
  • November 12, 2014

As its an array you will probably need plist buddy. I think this post is what you are looking for:

https://jamfnation.jamfsoftware.com/discussion.html?id=5010

Each new entry has three elements:

/usr/libexec/PlistBuddy -c "Add :favoriteservers:CustomListItems:0 dict" ~/Library/Preferences/com.apple.sidebarlists.plist
/usr/libexec/PlistBuddy -c "Add :favoriteservers:CustomListItems:0:Name string afp://server1.company.com" ~/Library/Preferences/com.apple.sidebarlists.plist
/usr/libexec/PlistBuddy -c "Add :favoriteservers:CustomListItems:0:URL string afp://server1.company.com" ~/Library/Preferences/com.apple.sidebarlists.plist

You will need to add a "killall cfprefsd" at the start otherwise preference caching will trample all over it.

Hope this helps!