I have a script to mount shares for a mac. I use
mkdir -p /Volumes/volumename
mount -t smbfs //servername(IPaddress)/sharename/foldername /Volumes/volumename
I then have aliases on the desktop to display a different name for the folder than the share name. Everything works fine if I am connected to the domain. The user is logging in using windows domain credentials. When the user is off the domain and using the vpn the script fails with an authentication error. If the user clicks on one of the aliases on the desktop it says, "The alias 'AliasName' can't be opened because the original item can't be found" This is understandable since the script hasn't mounted the volumes yet but if the user clicks ok and the runs the script again the script runs fine without any authentication errors and all volumes are mounted. The aliases on the desktop can then be opened and they resolve. Also if I put the username and password into the script it works but this is not a solution that will work as per the domain policy passwords are changed every 90 days. I am looking to mount these volumes cleanly when the user is connected to the VPN.
Any help with this would be greatly appreciated,