/build/static/layout/Breadcrumb_cap_w.png

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)

Posted by: anonymous_9363 10 years ago
Red Belt
0

Ask Mr G and he will tell you...

http://technet.microsoft.com/en-us/library/ee156576.aspx

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ