I am recently configure Samba4 as described in this guidance : https://imanudin.net/2014/11/16/how-to-install-samba4-active-directory-on-centos-7-part-1/ and configure some folder share. Users can access the folder share on the server with address \\file-server or \\ip-address-of-server in Windows clients. Users can map drive manually by right click in the folder share and select Map Network Drive. But, i want to configure map drive automatically. The following is how to configure it.
– Create file with extension .bat in netlogon script folder. The location folder is usually in /usr/local/samba/var/locks/sysvol/imanudin.net/scripts
– For example, the filename is umum.bat. Fill the file umum.bat with the following configuration
net use L: \\samba4.imanudin.net\umum
Note :
* L is the drive who will listen in Windows
* samba4.imanudin.net is file sharing server
* umum is folder who want to map
* If you want to map another folder share, please add at the bottom line
– Save and give an execution access
chmod +x umum.bat
Enter to Windows client by login as Administrator and ensure RSAT has been installed. Select run menu and type dsa.msc and hit enter. Select some users or all users | right click and choose properties | select Profile and checklist in the Logon script section. Type the name of script that has been created in above description. Apply and OK
Please try to logout and login again. Users who have configured will automatically map drive when login
Good luck and hopefully useful 😀
Awesome, work’s very well here, ty for the tip!