|
|
|||||||
I am using logon scripts on a NT 4.0 server. I would like to be able to have the script wright to a .txt file on the server each time it is run giving me information like USERNAME, IPADDRESS, COMPUTERNAME, TIME. Dose anybody know how to do this? Brett |
||||||||
|
|
|||||||
Goodmorning Brett, I the logon-script I use, the followimg lines appends a line to the CheckUser.csv file (a Microsoft Excel Comma Separated Values File) each time a user logs on to their domain. $FLServer="your server" OPEN(1,"\\$FLServer\log$\CheckUser.csv",5) The users should have change rights on the share log$ and the directory on the fileserver $FLServer. The Information appended to the CheckUser.csv file is a single line existing of; Hostname, 1e IPAddress, UserID, Date and time of their current logon. I hope this was of some assistance to you..?? Greetings, Fabian. |
||||||||
|
|
|||||||
Hi All... As an addition to the script parts above, I used the $IPNOSPACES part to log the IPAddresses as well, and the $LoggonFileName is the file to log the info to, where a new filename is used every day automatically. Regards, Marc $LogServer="NLNAV010" ------------------ |
||||||||
|
|
|||||||
Thanks for the help. Here is a copy of what I ended up with. ; ----------------------------------- $FLServer="CENTRALPDC" Thanks again, Brett |
||||||||
|
|
|||||||
Just as a matter of interest, @IPAddress returnes dots in the IP Address so you can use the following statement, which is a bit shorter and easier to read. $IPNOSPACES=(LTRIM(SUBSTR(@IPAddress0,1,4)))+(LTRIM(SUBSTR(@IPAddress0,5,4)))+(LTRIM(SUBSTR(@IPAddress0,9,4)))+(LTRIM(SUBSTR(@IPAddress0,13, 3))) Regards, |
||||||||
|
|
|||||||
I went down this road awhile back and what I discovered was that a flat format in your csv files does not lend well towards importing them into an ever-changing database. What you need is a key which is defined for every attribute, then eventually when you have all your .csv files collected you can dump the contents of them into a single table and run a cross-tab query (in access) to have the columns generated. I've got the whole thing working, ..my csv's are automatically copied to the local domain server, then a service on the server fires the csv off to the central server over a WAN, then this csv file is gobbled up by the main database. It's actually pretty bitchin once you get it all going. Here's the part that you should pay attention to now before you get too far down the road (if you plan on using the information in a dynamic database down the road).. My export code looks like this:
;----------------------------------------------------------------- DIM rtn $export_file = $logfile_directory + "\" + $physical_mac + ".csv" del "$logfile_directory\*.csv" $rtn = writeline(10, '"$physical_mac","comp_name","$comp_name"$n') $rtn = writeline(10, '"$physical_mac","total_dev","$total_dev"$n') $rtn = writeline(10, '"$physical_mac","msnet_ver","$msnet_ver"$n') $rtn = writeline(10, '"$physical_mac","vs_ver","$vs_ver"$n') $rtn = writeline(10, '"$physical_mac","user_profiles","$user_profiles"$n') $rtn = close(10)
------------------
|