On MacOS (Mojave), I mount SMB shares from a Bash script using
open "smb://$user:$pass@$server/$share"
This works fine, but the ico