This script will scan for all SMB devices in your network, then it will scan for all the shares on these devices and mount them.
It will create a file containing your credentials in plain text in /home/username/.smbcredentials
.
It will also save the shares in etc/fstab
so that they will be automatically mounted on startup.
The script needs to be executed as root.
sudo bash SMB-AutoMount.sh MOUNTPOINT_ROOT LINUX_USERNAME WINDOWS_USERNAME WINDOWS_PASSWORD WINDOWS_DOMAIN
The root directory in which a folder for each smb device will be created. (The folders for the smb devices will then contain additional folders for the actual shares.)
My advice would be something like /media/windows-network
.
The user for which the shares should be accessable.
Note: I don't know what happens if you actually logon with a different user with the gui. Maybe it just works or it asks you for login details of every single share. I just havent tried it yet.
The username that will be used for authentication to access the network shares.
The password that will be used for authentication to access the network shares.
The domain that will be used for authentication to access the network shares.
I have only tested this with Ubuntu 16.04 on a corporate windows network.