Need help with this Kix script

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
dasridhar
Posts: 2
Joined: Mon Nov 27, 2006 12:46 am

Need help with this Kix script

Post by dasridhar » Wed Apr 08, 2009 2:40 am

Hi Experts,

Am new to scripting and am looking for help.
I have a script that logs information of user when he logs on.

This is the script :

$LogPath="serversharefolderUserLOG"$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="Name : @FULLNAME" GOSUB WRL$LogText="comments : @COMMENT" GOSUB WRL$LogText="Accesstype : @PRIV" GOSUB WRL$LogText="Computername : @WKSTA" GOSUB WRL$LogText="DNS Host : @HOSTNAME" GOSUB WRL$LogText="IP-address : @IPADDRESS0" GOSUB WRL$LogText="MAC-Address : @ADDRESS" GOSUB WRL$LogText="Domain : @DOMAIN" GOSUB WRL$LogText="Logon Domain : @LDOMAIN" GOSUB WRL$LogText="Logon Server : @LSERVER" GOSUB WRL
; Loginscript...
IF $LogError=0 $LogText="" GOSUB WRL $RES=CLOSE(5)ENDIFEXIT
; Skriv til logfil...
:WRLIF $LogError=0$RES=WRITELINE(5,$LogText+$RETURN)ENDIFRETURN


Result:

.log file is created with user name
xxxxx - Wednesday 25. March 2009 - 09:42:38
Name : xxxxx, xxxxxcomments : xxxxx
Accesstype : ADMINComputername : xxxxxxxxDNS Host : xxxxxxxIP-address : xxxxxxxx
MAC-Address : 0x0xx14xDomain : xxxxxxxLogon Domain : xxxxxxLogon Server : xxxx

Script works great.
Here is what am looking for.

1# It should write to a csv file with logged on user.
2# It should put the data in colums
3# Need to grab asset information and write to the next colum.

Any help is appreciated.

Regards,










User avatar
dasridhar
Posts: 2
Joined: Mon Nov 27, 2006 12:46 am

Need help with this Kix script

Post by dasridhar » Wed Apr 08, 2009 3:28 am

Nope..am trying to learn

User avatar
jhicks
Posts: 1789
Joined: Sun Jan 21, 2007 11:31 pm

Need help with this Kix script

Post by jhicks » Wed Apr 08, 2009 3:41 am

You'll also be limited to whatever the user has permissions to access.

Locked