|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: |
strComputerSource = "."
strComputerDestination = "Remoteserver"
Set objWMIService = GetObject("winmgmts:\\" & strComputerSource & "\root\cimv2")
Set colEvents = objWMIService.ExecNotificationQuery _
("Select * From __InstanceCreationEvent Where " _
& "TargetInstance isa 'Win32_NTLogEvent'")
Do
Set objEvent = colEvents.NextEvent
If InStr(LCase(objEvent.TargetInstance.Type), Error) Then
Wscript.Echo Now
Wscript.Echo "Category: " & objEvent.TargetInstance.Category
Wscript.Echo "Event Code: " & objEvent.TargetInstance.EventCode
Wscript.Echo "Message: " & objEvent.TargetInstance.Message
Wscript.Echo "Record Number: " & objEvent.TargetInstance.RecordNumber
Wscript.Echo "Source Name: " & objEvent.TargetInstance.SourceName
Wscript.Echo "Event Type: " & objEvent.TargetInstance.Type
Wscript.Echo
strDescr = "At " & objEvent.TargetInstance.TimeGenerated
strDescr = strDescr & " the server encountered Description: " & objEvent.TargetInstance.Message
set objWSHShell = Wscript.CreateObject("Wscript.Shell")
boolRC = objWSHShell.LogEvent(1, strDescr, strComputerDestination)
End If
Loop
|
Advertisement
| Hall of Fame |