Re: TWAPI event log code
- From: palmtcl@xxxxxxxxx
- Date: 30 Aug 2006 20:09:09 -0700
See http://twapi.sourceforge.net/examples.html#eventlog for an example.
To read remotely, add the option -system REMOTESYSTEM to the example's
open_eventlog line so it would read something like
twapi::eventlog_open -source $source -system magicsplat
(where magicsplat is the remote system name, $source would generally be
Application, Security or System depending on which remote event log you
wanted to access)
Note that Gerald's response below will run without errors but will
return events from the local Application event log, not the remote
system! That's because the Windows OpenEventLog function will simply
assume the source as "Application" on the local system if the file
specified as the value of the -source argument is not found.
/Ashok
Gerald W. Lester wrote:
ejcottrell@xxxxxxxxxxx wrote:
Does anyone have experience coding with the TWAPI functions? I am
trying to figure out if it is possible to remotely access the event
viewer of another computer. Sample scripts would be great.
Did you look at the documentation at http://twapi.sourceforge.net/ ???
Here is a sample script:
package require twapi
set ehd [twapi::eventlog_open -source {\\RemoteNode}]
while {[llength [set dataList [twapi::eventlog_read $ehd]]]} {
foreach record $dataList {
puts stdout $record
}
}
twapi::eventlog_close $ehd
--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
.
- Follow-Ups:
- Re: TWAPI event log code
- From: palmtcl
- Re: TWAPI event log code
- References:
- TWAPI event log code
- From: ejcottrell
- Re: TWAPI event log code
- From: Gerald W. Lester
- TWAPI event log code
- Prev by Date: Re: TWAPI event log code
- Next by Date: Re: TWAPI event log code
- Previous by thread: Re: TWAPI event log code
- Next by thread: Re: TWAPI event log code
- Index(es):
Relevant Pages
|