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
Thanks so much! Thats pretty awesome much appreciated
How did you push this out with casper after making the application? @imagswadmin @mvu
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:
- Drag the H Drive to your Applications folder
- Open Composer
- Drag the H Drive in the SOURCES window
- Change permissions as needed (I like to send it out as a PKG over DMG)
- Build as PKG
- Drag the H Drive to your dock
- Upload the package to Casper Admin
- Add the H Drive Dock item
- Set a policy to push out the package and dock item
Just curious - what are the permissions you use in Composer?
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.
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
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?!
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.
Did you enter your correct server share address inside the quotes? Example: "smb"//your/server/share/HERE/"