Hi,
You can get that information from the log file '/var/log/samba/samba.log'. So, the best approach is to create a shell script that search, parse and display the information as you want.
Below you have two commands that you can try to retrieve the information you are looking for:
## Login
grep -B 1 'connect to service netlogon' /var/log/samba/samba.log
## Logout
grep -B 1 -P 'closed connection to service (?!.*IPC|netlogon)' /var/log/samba/samba.log
--
“This world is ours, and by the Holy Light we will keep it safe, now and forever".