Skip to main content
Question

Add SMB Network Share To Dock

  • February 3, 2014
  • 9 replies
  • 94 views

Forum|alt.badge.img+3

Under configuration profiles I tried to add a dock item pointing to an SMB share (smb://servername/sharename) but I just get a big question mark in the dock. What is the best way to add a network share to the dock?

I know I can add a network mount as a login item but this doesn't work very good for mobile users that boot up their laptop and then VPN.

9 replies

karthikeyan_mac
Forum|alt.badge.img+18
  • Honored Contributor
  • February 3, 2014

Create a webloc file and put it on the dock. We don't add it dock but we add to users desktop.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>URL</key>
    <string>smb://abc.yourservername.com/share</string>
</dict>
</plist>

Thanks,
Karthikeyan


Forum|alt.badge.img+5

This allows for specifying cifs: over smb: where required, and may therefore make it genius, great, thanks.


Forum|alt.badge.img+15
  • Esteemed Contributor
  • February 3, 2014

You might look into putting dockutil on your machines.

/usr/local/bin/dockutil --add smb://server/share/folder --label 'Network Share' --position end /Users/$user

Forum|alt.badge.img+9
  • Contributor
  • February 3, 2014

For those who might like the link to dockutil, you can find it here...
https://github.com/kcrawford/dockutil


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • February 4, 2014

Thanks for the posts everyone! Karthikeyan.mac, that PLIST that you posted doesn't seem to work when I add it as a custom setting under the configuration profile. Is there another way to deploy it out?

The preference domain I am using is "com.apple.dock".


Forum|alt.badge.img+24
  • Valued Contributor
  • February 5, 2014

Forum|alt.badge.img+3
  • New Contributor
  • April 17, 2015

@cbrewer

I have tried your script with dockutil and ran it as part of the login policy, and found that the script ran as "root" instead of the user, so my $user is root instead of the logged in user. Any idea how to fix this?


daz_wallace
Forum|alt.badge.img+13
  • Contributor
  • April 17, 2015

Hi @wilsonch

I've added the following to our dockutil script to get it to work as the user:

username="$3"
    if [ -z "$username" ]; then       # Checks if the variable is empty (user running script from Self Service)
        username="$USER"
    fi
echo "User: $username"
dockutil="/etc/amsys/dockutil"

su "$username" -c "$dockutil --remove all"

su "$username" -c "$dockutil --add '/Applications/Microsoft Office 2011/Microsoft Word.app'"

etc

Hope that helps!

Darren


Forum|alt.badge.img+21
  • Valued Contributor
  • September 3, 2021

Why not just use a profile to add an item to the Dock?

 

You can even use variables for the username etc.  If the device is bound, the user will already have a TGT (verify using klist) from AD.  If the device is not bound, you could use the Kerberos Single Sign-on Extension to get the user a TGT from AD.