Mount SMB share?

mvalpreda
New Contributor II

Looking for the most reliable way to push SMB shares through Jamf Pro. I see a lot of old threads, scripting, 47 different approaches, etc. Never felt like I really saw a definitive answer.

I have ~100 AD-joined Macs on Jamf Pro (cloud hosted). We're moving 10 shares from our current Windows-based file shares to a Linux-based NAS that uses AD for authentication. Currently users just go to Finder and connect to server (Command + K), but really want to automate connections to shares and any updates we have in the future.

Appreciate any input on a nice and reliable way to do this!

7 REPLIES 7

CSCC-JS
Contributor II

Also very interested in this thread.

mark_mahabir
Valued Contributor

We've used a variety of solutions in the past but in recent years have settled on the built-in functionality of NoMAD, which seems to be pretty robust.

lehose
New Contributor II

Did you ever find a solution for this? I'm also struggling find a good method that won't prompt for credentials.

jcarr
Release Candidate Programs Tester

Why not just use a profile to add an item to the Dock?Screen Shot 2021-09-03 at 3.46.47 PM.png

 

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.

lehose
New Contributor II

Thanks for the response.  I'll look into that.  

 

My last attempt was with creation of an app using Apple Automator to mount the drives.  This worked for me when I was logged into the machine, but it's not a valid solution for our pc imaging team.  I've been trying the following from the enterprise connect documentation

#!/bin/bash

userName=$(stat -f %Su /dev/console)
adRealm=pretendco.com
passwordReminder=30
# Add pretendco.com domain
sudo -u $userName -H defaults write ~/Library/Preferences/com.apple.Enterprise-Connect adRealm
-string "$adRealm"
# Notify the user 30 days before password expiration
sudo -u $userName -H defaults write ~/Library/Preferences/com.apple.Enterprise-Connect
passwordNotificationDays -int "$passwordReminder"
# Populate Enterprise Connect share
sudo -u $userName -H /usr/libexec/PlistBuddy -c "add :shares array" ~/Library/Preferences/
com.apple.Enterprise-Connect.plist
sudo -u $userName -H /usr/libexec/PlistBuddy -c "add :shares:dict:path string smb://
server.pretendco.com/Users/$userName" /Users/$userName/Library/Preferences/com.apple.Enterprise-Connect.plist
The commands complete without error, but it doesn't look like the plist was created.

CSCC-JS
Contributor II

@jcarr That works, however, the shortcut ends up being a "?".

Tried using "smb" and "cifs".

SmilieK
New Contributor III

If using the SSO Plugin take a look at Section 5 of this guide for how to have Drives "Auto-Mount" when connected to the network. https://hcsonline.com/images/PDFs/Jamf_Kerberos.pdf