Posted on 02-11-2019 06:16 AM
Hello,
I have a little problem that doesn't concern Jamf Pro but rather MacOS.
Maybe you can help me (I hope ...).
I use scripts to mount network volumes on our client computers.
Our computers are bound in Active Directory.
All volumes on SANs mount without problems (as long as the AD user permissions is good).
But with volumes on a NAS, the volumes doesn't mount for the good reason that it requires to put login / password while the AD session has the right permissions for volumes.
Do you know how to ensure that volumes coming from a NAS can mount without authentication on an AD session just like a SAN volume ?
Thank you for your help
Posted on 02-25-2019 06:29 AM
Sorry to up post (I don't like doing that), but please, if someone had a solution or an idea to share ....
Thank you and wish you a good day...
Posted on 03-04-2019 05:57 AM
Hi,
After multiple tests, I realize that when opening a new AD session for the first time, I can mount a NAS volume without it asking me authentication.
Once I close the session, it's over, every time I want to mount a NAS volume with this profile, it asks me to authenticate even if the AD profile has the necessary permissions.
I deleted the keychain, but it does not work.
So impossible to set up a script to mount the volumes automatically.
Very frustrating
Thanks
Posted on 03-04-2019 07:21 AM
Can your NAS be setup to accept Kerberos tickets or for LDAP integration?
Posted on 03-04-2019 08:22 AM
@ShaunRMiller83 Thanks for your answer.
Our NAS is configured for AD/LDAP integration
Posted on 03-05-2019 06:01 AM
@glpi-ios What does the line of code look like that mounts the volume?
Posted on 03-13-2019 09:56 AM
Thank you for your answer
We have seen with our provider who asks us to mount the volumes with 'cifs://'.
But this is not the same as smb protocol?
Moreover, we mount the volumes with SMB but with 'cifs: //' it does not work at all....
Thanks
Posted on 03-13-2019 09:59 AM
@glpi-ios Do you use "osascript mount volume" or do you use the "mount" command?
Posted on 03-13-2019 10:05 AM
loggedInUser=$(stat -f%Su /dev/console)
umount -Af -t nfs,smbfs
rmdir /Volumes/*
sleep 5
mount_script=`/usr/bin/osascript > /dev/null << EOT tell application "Finder"
try
mount volume "smb://xxx/xxx"
end try
end tell
EOT`
exit 0
But we have the same problem to mount volume manually, we have authentification window with the AD session has the right permissions for volumes.
Posted on 03-13-2019 12:10 PM
@glpi-ios Can you try this:
#!/bin/bash
protocol="smb"
loggedInUser=$(/usr/bin/python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "
");')
server="server_name_goes_here.contoso.com/share_name_goes_here"
fullPath="${protocol}://${loggedInUser}:@${server}"
umount -Af -t nfs,smbfs
rmdir /Volumes/*
sleep 5
# Mount the drive
/usr/bin/osascript -e "mount volume "$fullPath""
exit 0
Posted on 03-14-2019 02:47 AM
Thanks for your help.
But I have the same result. I need to authenticate :(
What seems odd is that when I open an AD profile for the first time on a computer, I can connect to a NAS volume without authenticating.
But as soon as I log off, every time I log in again, I need to authenticate to mount the same volume and all NAS volumes again.
I empty the Keychain but without success....
:(
Posted on 03-14-2019 06:07 AM
@glpi-ios This script is being run in a policy by Jamf, or in a LaunchAgent?
Can you attempt to locally run the script as the user, to see if you get any different behavior? Put the script on the desktop while logged into the machine and in terminal as the user execute the script.
Posted on 03-14-2019 07:50 AM
@ryan.ball I've tried locally as you explain and with policy. But I have same result.
I've tried with native MacOS 10.12, 10.13 and 10.14.
The only thing I do is binding in our AD then log in with AD accounts with permissions on our NAS volumes.
With SAN volumes, no problem, we don't have to authenticate if the account have good permissions.
Only with our NAS.