Click here to return to the KiXtart HelpDesk main page...

KiXtart Script Depot

Logging

; ScriptNavn:  Logging.kix
; Lavet af:     Brian Petersen
; Dato:          04.12.1999     
; Beskrivelse: A central network logon log.
;
; It is often interesting to log certain onformation to a central placed log file.
; Note that the users must have Write Access to the file but not Read or Delete rights.

$LogPath="\\FILSRV\ALLE_DBSHARE\LOG"
$LogFile="$LogPath\@USERID.LOG"
$RETURN=CHR(13)+CHR(10)

$LogError=OPEN(5,$LogFile,5)

$LogText="@USERID - @DAY @MDAYNO. @MONTH @YEAR - @TIME" GOSUB WRL
$LogText="" GOSUB WRL
$LogText="Navn : @FULLNAME" GOSUB WRL
$LogText="Afdeling : @COMMENT" GOSUB WRL
$LogText="Brugertype : @PRIV" GOSUB WRL
$LogText="Computernavn : @WKSTA" GOSUB WRL
$LogText="DNS Host : @HOSTNAME" GOSUB WRL
$LogText="IP-adresse : @IPADDRESS0" GOSUB WRL
$LogText="MAC-Adresse : @ADDRESS" GOSUB WRL
$LogText="Domain : @DOMAIN" GOSUB WRL
$LogText="Logon Domain : @LDOMAIN" GOSUB WRL
$LogText="Logon Server : @LSERVER" GOSUB WRL
$LogText="Novell Server : \\$NWSERVER" GOSUB WRL
$LogText="Konfiguration : $TYPE" GOSUB WRL

; Loginscript...

IF $LogError=0
  $LogText=""
  GOSUB WRL
  $RES=CLOSE(5)
ENDIF
EXIT

; Skriv til logfil...

:WRL
IF $LogError=0
$RES=WRITELINE(5,$LogText+$RETURN)
ENDIF
RETURN