Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
November 1, 2004, 12:01 pm
rate this thread
Win2000 servers whenever I try to use vbs to read the event log: "
ActiveX component can't create object: 'GetObject'"
Heres the code I am using:
<!-- event log -->
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "!\" & strComputer &
Set colLoggedEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent Where Logfile = 'Application'")
For Each objEvent in colLoggedEvents
Wscript.Echo "Category: " & objEvent.Category
Wscript.Echo "Computer Name: " & objEvent.ComputerName
Wscript.Echo "Event Code: " & objEvent.EventCode
Wscript.Echo "Message: " & objEvent.Message
Wscript.Echo "Record Number: " & objEvent.RecordNumber
Wscript.Echo "Source Name: " & objEvent.SourceName
Wscript.Echo "Time Written: " & objEvent.TimeWritten
Wscript.Echo "Event Type: " & objEvent.Type
Wscript.Echo "User: " & objEvent.User
<p><a href="vbscript:eventlog">Check Event Logs</a> </p>
Re: cant read the event log! DOH!!! Please help...
> Win2000 servers whenever I try to use vbs to read the event log: "
> ActiveX component can't create object: 'GetObject'"
Are you *sure* you meant to post your question in a newsgroup about writing
HTML for the World Wide Web?
- » how to implement oncontextmenu="return false;" to pass the W3C parser ?
- — Next thread in » HTML Authoring Forum
- » wmv in html page does not allow scanning the timeline
- — Previous thread in » HTML Authoring Forum