mount network share on non-AD computer for specific user

New Contributor III

I'm trying to map the network share to over 80 Macs and can't get it to work on my test system.
Here is my setup:
1. Macs aren't bound to AD (have Beta app installed that won't work with mobile accounts)
2. Standard user Account (can't have users with local admin account)
3. Network share is hosted on Windows server that is in AD
4. Have service AD account, so I can use in scripts
If I run following commands first, as local admin with sudo BUT not as root, I can mount the drive. Then as standard user, using the script below, I can get it on the user's desktop:
mkdir /Volume/SOP
mount_smbfs //domainuser:'domainpassword' /Volume/SOP
and I run the script as standard user:


theuser=$(/usr/bin/who | awk '/console/{ print $1 }')

/usr/bin/osascript > /dev/null << EOT

try mount volume "smb://" end try


echo $theuser

killall cfprefsd
defaults write ShowMountedServersOnDesktop true
killall -HUP Finder