**DONOTDELETE**
(Lurker)
2000-03-14 10:14 AM
Collecting login data

I need to be able to collect information from workstations into a central file on the server as users login. I have had this working where it creates a separate file for each user, but I need the information to be clloected into 1 file for the whole network. I thought I had this working but then often got file in use type errors.

Any ideas ?

**DONOTDELETE**
(Lurker)
2000-03-15 02:24 AM
Re: Collecting login data

This is what I use:

:InfoLog
$OS=%OS%
If $OS <> "Windows_NT" $OS = "Windows_9x" Endif
RedirectOutput("$Xdrive\InfoLog.csv")
? "@IPADDRESS0,@WKSTA,$OS,@ADDRESS,@USERID,@DATE,@TIME"
RedirectOutput("")
return

Hope this helps,
Bonk

**DONOTDELETE**
(Lurker)
2000-03-15 08:11 AM
Re: Collecting login data

Hi there!

Maybe the example below can help you!
http://kixtart.to/script/board/ubbhtml/Forum2/HTML/000318.html

Regards,

Marc

------------------
M.A.C. Duiker (Marc)
Migration Specialist (MCSE)
MarcDuiker@CompuServe.com



Bryce
(KiX Supporter)
2000-03-16 09:11 AM
Re: Collecting login data

here is the log file that i use in my system.

You call it with a GOSUB LogFile, edit $file to point where you want the log file to be.


code:

;****************************************************
:logfile ;v1.62 by Bryce Lindsay
;****************************************************
; write a log file of when people logon to the system

dim $file ;set temp $file variable
dim $linetowrite ;set test $linetowrite variable
dim $ip
dim $a
dim $b
dim $c
dim $d
dim $abcd


$file = "\\houston\syswr\log\logon.log"
$IP = @ipaddress0 ; #ip#
$a = LTRIM(SUBSTR(@IPADDRESS0, 1, 3)) ; #ip#
$b = LTRIM(SUBSTR(@IPADDRESS0, 5, 3)) ; #ip# Get the IP# and assign it to $ipadr
$c = LTRIM(SUBSTR(@IPADDRESS0, 9, 3)) ; #ip#
$d = LTRIM(SUBSTR(@IPADDRESS0, 13, 3)) ; #ip#
$IPADR = "$a.$b.$c.$d" ; #ip#
$linetowrite = "@fullname, @userid, @wksta/$abcd, @monthno/@mdayno/@year, @time"

:logfile2
if open(10, $file, 4) = 0
$q = writeline(10, $linetowrite + chr(13) + chr(10))
$q = close (10)
else
if open (10,$file,1) = 0
$q = close (10)
$q = open(10, $file, 4)
$q = writeline(10, "KIX Log file 1.5" + chr(13) + chr(10))
$q = writeline(10, "By bryce.lindsay@@oshmans.com" + chr(13) + chr(10))
$q = writeline(10, "===============================================" + chr(13) + chr(10))
$q = writeline(10, "Full Name, UserID, computername/IP#, Date, Time" + chr(13) + chr(10))
$q = close (10)
goto logfile2
else
? "Log File could Not be created."
endif
endif
return



Bryce