Home All Groups Group Topic Archive Search About


Author
8 Oct 2007 12:41 PM
nick
Hello,

I have 1 DC  & ADC i need copy both the server event logs in Acces database.
I copied this script from the Microsoft web site(http://www.microsoft.com/technet/scriptcenter/scripts/logs/eventlog/lgevvb03.mspx)

Set objConn = CreateObject("ADODB.Connection")
Set objRS = CreateObject("ADODB.Recordset")




objConn.Open "DSN=EventLogs;"
objRS.CursorLocation=3
objRS.Open "SELECT * FROM EventTable" , objConn, 3, 3
strComputer = "."

Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colRetrievedEvents = objWMIService.ExecQuery _
    ("Select * from Win32_NTLogEvent")

For Each objEvent in colRetrievedEvents
    objRS.AddNew
    objRS("Category") = objEvent.Category
    objRS("ComputerName") = objEvent.ComputerName
    objRS("EventCode") = objEvent.EventCode
    objRS("Message") = objEvent.Message
    objRS("RecordNumber") = objEvent.RecordNumber
    objRS("SourceName") = objEvent.SourceName
    objRS("TimeWritten") = objEvent.TimeWritten
    objRS("Type") = objEvent.Type
    objRS("User") = objEvent.User
    objRS.Update
Next

objRS.Close
objConn.Close

i need specification about this scripts. & setps for how to create database
& link to this script.

Nick...................
+919821030605

AddThis Social Bookmark Button