How do I setup logon.bat scripts for my AD users?

Hello @greavette,

Partially. You have to have Nethserver Samba DC(http://docs.nethserver.org/projects/nethserver-devel/en/v7/nethserver-dc.html) installed and running. Now Samba 4 is used and there is no “logon script = netlogon.bat” directive anymore. So you have to map the logon script via RSAT Tools. Here an example of user markus having netlogon.bat set as logon script(Win 7 VM screenshot):

On your Nethserver:

mkdir -p /var/lib/machines/nsdc/var/lib/samba/sysvol/cmb.local/scripts
touch /var/lib/machines/nsdc/var/lib/samba/sysvol/cmb.local/scripts/netlogon.bat
chmod 777 /var/lib/machines/nsdc/var/lib/samba/sysvol/cmb.local/scripts/netlogon.bat

Even if I set the rights to 777 only domain admins can access the netlogon share, but you may set it to 755 when you are ready with your netlogon.bat script, just for security.

Now you have access as domain admin from a Windows PC to “\\nsdc-server\netlogon\netlogon.bat” and may edit the netlogon.bat script to your needs to avoid dealing with different line breaks. Here you can see an example how to manage everything in a single logon script with if %username%. I put a pause in the logon script for testing.

Hope this will help you…

7 Likes