Posted on 02-03-2014 06:47 AM
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.
Posted on 02-03-2014 07:06 AM
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
Posted on 02-03-2014 07:21 AM
This allows for specifying cifs: over smb: where required, and may therefore make it genius, great, thanks.
Posted on 02-03-2014 08:15 AM
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
Posted on 02-03-2014 09:22 AM
For those who might like the link to dockutil, you can find it here...
https://github.com/kcrawford/dockutil
Posted on 02-04-2014 05:18 AM
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".
Posted on 02-04-2014 08:45 PM
Have a look at my solution here https://jamfnation.jamfsoftware.com/discussion.html?id=5824
Posted on 04-16-2015 10:11 PM
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?
Posted on 04-17-2015 12:46 AM
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
Posted on 09-03-2021 12:50 PM
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.