Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recording Login/Logoff Activity

Status
Not open for further replies.

abovebrd

IS-IT--Management
May 9, 2000
690
0
0
US
<br>I am looking for a way to record or archive the login and logoff times that users authenticate to my PDC or BDC. <br>We are using windows 98 workstations. I understand this information is avaiable through the event log, but I would like to record this information in a seperate archive.<br>Could this be done through a login script ??<br><br>I am not sure where to begin ?
 
Offhand I can't think of a good way to do it from 98 stations through a logon script and that won't capture logoffs anyway.&nbsp;&nbsp;There are programs that can generate reports from the event log.&nbsp;&nbsp;Keep in mind that there are separate event logs on the PDC and BDC and a persons log on will be on whichever one answers the authentication query first, so you need to merge the info to get acomplete picture. <br><br>I seem to recall a freeware program that could dump the most recent logon for all users.&nbsp;&nbsp;Look around on <A HREF=" TARGET="_new"> <p> Jeff<br><a href=mailto: masterracker@hotmail.com> masterracker@hotmail.com</a><br><a href= > </a><br> Of all the things I've lost in life, I miss my mind the most ...
 
I have written a small VB application that is put on the machines startup menu. This app gets the user id, current day and time, and reports it to a data file. I would be happy to give you this app. It took about 2 minutes to write. Unfortunately, it will not record any logoff activity.
 
tclere,<br><br>That sounds like a start in the right direction. I would like to try out your VB application.<br><br>My direct e-mail is <A HREF="mailto:dannyd@aboveboardelectronics.com">dannyd@aboveboardelectronics.com</A>
 
I will send the app. FYI - here is the code<br><br>Declare Function GetUserName Lib &quot;advapi32.dll&quot; Alias &quot;GetUserNameA&quot; (ByVal lpBuffer As String, nSize As Long) As Long<br><br>Sub Main()<br>&nbsp;&nbsp;&nbsp;&nbsp;Dim lpBuff As String * 25, ret As Long, UserName As String<br>&nbsp;&nbsp;&nbsp;&nbsp;ret = GetUserName(lpBuff, 25)<br>&nbsp;&nbsp;&nbsp;&nbsp;Open (&quot;D:\Temp\inlog.dat&quot;) For Append As #1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Print #1, UCase(Left(lpBuff, InStr(lpBuff, Chr(0)) - 1)) & &quot; @ &quot; & Now<br>&nbsp;&nbsp;&nbsp;&nbsp;Close #1<br>End Sub<br><br>The following sample string is appended to the log file.<br><br>XYZ @ 6/2/00 6:14:44 AM<br><br><br>
 
Is this VBscript code are Visual Basic code
 
I would recommend you to turn on auditing instead and filter the event logs with Crystal Reports or any other report generator.<br><br>Regards<br><br>Lars<br>
 
This is VB6 using the Windows API.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top