Set:
utmp = yes
utmp dir =/var/adm/utmp
In your smb.conf
Then you can view the report with the `last` command as stefanwagner mentioned.
If you want to seperate it, maybe you can put something the a logon and logoff script.
logon script = logon.bat
logoff script = logoff.bat
"If you always do what you've always done, you will always be where you've always been."