hello
i'm working on logs on wk3 server and i am searching for a way to search some id events on event vwer and those selected will be write on a text file..
here is my code
yeah it is not very developped, actually im also looking to
repair these errors, browsing technet for eventually a list of these event id on my wk3 server...if someone nows something about it glad to know..
feel free to comment my code
thanks
i'm working on logs on wk3 server and i am searching for a way to search some id events on event vwer and those selected will be write on a text file..
here is my code
Code:
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFso.createTextFile("C:\scripts\LogID.txt")
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colLoggedEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent Where Logfile = 'Application'")
For Each objEvent in colLoggedEvents
if ErrorEvent(objEvent) Then
objFile.WriteLine ("Event Code: ") & objEvent.EventCode & vbCrlf & _
objFile.WriteLine ("Event Type: ") & objEvent.Type & vbCrlf & _
objFile.WriteLine ("Message: ") & objEvent.Message
End If
Next
Function ErrorEvent(eventid)
objectEvent=False
If objEvent.Type(param)="Error" Then
Set objEvent=True
End If
End Function
yeah it is not very developped, actually im also looking to
repair these errors, browsing technet for eventually a list of these event id on my wk3 server...if someone nows something about it glad to know..
feel free to comment my code
thanks