Recording login name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

H
Is there some way of recording a users log in name in a log file/csv file each time they login
Thanks for the help
regard
Peter
 
In
Peter Moriarty said:
Hi
Is there some way of recording a users log in name in a log file/csv
file each time they login? Thanks for the help.
regards
Peter

enable auditing and logins will appears in the security log in Event
Viewer
 
Hi

I have developed a batch file which runs in the users logon script to record logon activity in a 300 computer network. You do not say if you are using a network or local machine, but I'm sure it can be adapted. See code below..

----------------------------------------------------------------------------------------------------------------------------------------
@echo of
for /F "tokens=6-9 delims=/- " %%A in ('net time') do
set month=%%
set day=%%
set year=%%C

if exist \\pdc\logs$\%year%\%month%\%day% goto toda
goto ne

:toda
echo %username%,%computername%,%lanid%,%logonserver%,%date%,%time%>>\\pdc\logs$\%year%\%month%\%day%\log.cs
goto en

:ne
if exist \\pdc\logs$\%year% goto mont

:yea
mkdir \\pdc\logs$\%year

:mont
mkdir \\pdc\logs$\%year%\%month

:da
mkdir \\pdc\logs$\%year%\%month%\%day
echo username,computername,lanid,logonserver,date,time>>\\pdc\logs$\%year%\%month%\%day%\log.cs

:lo
echo %username%,%computername%,%lanid%,%logonserver%,%date%,%time%>>\\pdc\logs$\%year%\%month%\%day%\log.cs

:en

------------------------------------------------------------------------------------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top