#156419 - 2006-02-01 06:12 PM
Needed way to log script use
|
NHA
Lurker
Registered: 2006-01-31
Posts: 2
|
I have inherited a KIX scripted environment where there appears to be a large number of defunct KIX scripts.
However with 5000+ users, it is difficult to tell for sure.
I wanted to create a line that I could include in each KIX script that would output to a log file some identification information when the cript gets run.
For example, in a batch file I would do something like
echo %user% ran this script at %time% >> \\server\netlogon\scriptlog.txt
If anyone can give me any suggestions I would appreciate it.
|
|
Top
|
|
|
|
#156424 - 2006-02-02 12:10 PM
Re: Needed way to log script use
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11629
Loc: CA
|
Quote:
Netlogon shares are normally read-only, aren't they?
Yes they are, even to Admins.
|
|
Top
|
|
|
|
#156425 - 2006-02-09 05:28 PM
Re: Needed way to log script use
|
NHA
Lurker
Registered: 2006-01-31
Posts: 2
|
Hi everyone. Just wanted to say your suggestions worked very well with just a little modification.
Here is what I ended up doing.
Open(1,"\\server\kixlog$\main2.txt",5) WriteLine(1,@userid+" Ran "+@scriptname+@date+@time+@crlf) Close(1)
Basicly created a hidden share with write permission for everyone. I know this is a bit of a security risk, but this is only for a short time untill I determine which scrupts are being used.
Thanx for all your help.
|
|
Top
|
|
|
|
#156426 - 2006-02-09 08:35 PM
Re: Needed way to log script use
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
This type of logging has been discussed several timesover the years. Using a single file can lead to file contention. I write a file for each computer and then have a service running on the server to consolidate the data from the individual files into a database.
|
|
Top
|
|
|
|
#156427 - 2006-02-09 08:42 PM
Re: Needed way to log script use
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
log it client side and then copy to the share.
@userid +'-'+@scriptname+'.txt' @date @time
and then build a simple script to collate the data that you run when you want a report
|
|
Top
|
|
|
|
#156429 - 2006-02-09 08:55 PM
Re: Needed way to log script use
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
it would be faster to make the file local then move it up.
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1183 anonymous users online.
|
|
|