Event Log Reporter date/time convert from UTC
I have a VBScript created by the configuration wizard that returns valuable Event Log information into KACE. However, the TimeWritten field being in UTC is not helpful. I am not familiar enough with VB to work in a conversion easily. Can I get some assistance?
strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colLoggedEvents = objWMIService.ExecQuery ("Select * from Win32_NTLogEvent " _ & "Where (LogFile = 'System') and (Type = 'Information') and (EventCode = '6006')") Set fso = CreateObject("Scripting.FileSystemObject") Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set file = fso.OpenTextFile(WScript.Arguments.Item(0), ForWriting, true) For Each objEvent in colLoggedEvents file.WriteLine("===") file.WriteLine("Category: " & objEvent.Category) file.WriteLine("Computer Name: " & objEvent.ComputerName) file.WriteLine("Event Code: " & objEvent.EventCode) file.WriteLine("Message: " & objEvent.Message) file.WriteLine("Record Number: " & objEvent.RecordNumber) file.WriteLine("Source Name: " & objEvent.SourceName) file.WriteLine("Time Written: " & objEvent.TimeWritten) file.WriteLine("Event Type: " & objEvent.Type) file.WriteLine("User: " & objEvent.User) Next file.Close()
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
anonymous_9363
11 years ago