Skip to main content
Solved

SMB Desktop/Dock Items

  • July 7, 2014
  • 11 replies
  • 58 views

Forum|alt.badge.img+3

Is it possible to mount SMB shares on to the dock using Dock items in Version 9.3 ?

We have mapped them as a file so smb://URL/Folder but they never apply they're SMB due to our NetApp appliance being SMB only.

If not does anyone have a better suggestion on how to do this effectively

Thanks

Best answer by mvu

I use Applescript to mount SMB shares, then export them as an app, change the icon (Maybe a Z icon), and finally push to my computers via policy and place them in the dock.

Users double-click the Z icon or whatever, authenticate and are in.

Copy and paste the code below in a new AppleScript document. Change the location to your path. Then export. Change File Format to Application. Save.

tell application "Finder" open location "smb://files.xx.xxxx.com/xxxxxxx"
end tell

11 replies

mvu
Forum|alt.badge.img+20
  • Jamf Heroes
  • Answer
  • July 7, 2014

I use Applescript to mount SMB shares, then export them as an app, change the icon (Maybe a Z icon), and finally push to my computers via policy and place them in the dock.

Users double-click the Z icon or whatever, authenticate and are in.

Copy and paste the code below in a new AppleScript document. Change the location to your path. Then export. Change File Format to Application. Save.

tell application "Finder" open location "smb://files.xx.xxxx.com/xxxxxxx"
end tell


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • July 8, 2014

Thanks so much! Thats pretty awesome much appreciated


Forum|alt.badge.img+10
  • Valued Contributor
  • July 8, 2014

How did you push this out with casper after making the application? @imagswadmin @mvu


mvu
Forum|alt.badge.img+20
  • Jamf Heroes
  • July 8, 2014

So the application is a self-contained app. It'd be no different than sending out a Firefox.app (without all the preferences and all). This is one way to do it. After you create the application, let's call it "H Drive", do this:

  1. Drag the H Drive to your Applications folder
  2. Open Composer
  3. Drag the H Drive in the SOURCES window
  4. Change permissions as needed (I like to send it out as a PKG over DMG)
  5. Build as PKG
  6. Drag the H Drive to your dock
  7. Upload the package to Casper Admin
  8. Add the H Drive Dock item
  9. Set a policy to push out the package and dock item

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

Just curious - what are the permissions you use in Composer?


mvu
Forum|alt.badge.img+20
  • Jamf Heroes
  • July 9, 2014

Sure. I let the top folder -- so this instance the Applications folder -- percolate its permissions all the way down.

So I click on the Applications folder in Composer (after you drag the H Drive into the SOURCES window). I click the grinding wheel in lower-right hand corner and select, "Apply Permissions to Applications and All Enclosed Items".

Worked well for me in my environment and many other scripts/apps. But your place requirements may differ.


Forum|alt.badge.img+3
  • New Contributor
  • November 13, 2014

Thanks for your solution mvu, it really for me out of a jam.

The only thing I added was the domain into the syntax.

tell application "Finder" open location "smb://domain;username:password@host/share"
end tell


Forum|alt.badge.img+3
  • New Contributor
  • February 7, 2020

I've managed to do this and push it out to myself and works well. When I push it to another user, it still works, but when launching it, the authentication window opens, with my username populated! Guess I've either missed something, or there is a way for this not to happen?!


Forum|alt.badge.img+3
  • New Contributor
  • March 9, 2020

Ive sorted this now :-)


Forum|alt.badge.img+3
  • New Contributor
  • July 7, 2020

I want to use the similar method to push SMB share icon on all JAMF enrolled mac. I tried to use script editor and put the below command. tell application "Finder" open location "smb://XXXXXXX/XXX/XXX/ "
end tell
However i am getting below error. but it is giving me syntax error - Expected end of line but found command name.


mvu
Forum|alt.badge.img+20
  • Jamf Heroes
  • July 7, 2020

Did you enter your correct server share address inside the quotes? Example: "smb"//your/server/share/HERE/"