3

Is there a way to search all the event-logs on a LAN for a specifc event?

030
  • 5,901
  • 13
  • 68
  • 110
cagcowboy
  • 1,072
  • 1
  • 14
  • 21

2 Answers2

3

You could broadcast the Windows event log events to a syslog server using a tool like the Eventlog to Syslog Service utility or a software like EventLog Inspector.

splattne
  • 28,508
  • 20
  • 98
  • 148
0

You can search the event log on remote machines with PowerShell, using System.Diagnostics.EventLog. Assuming the event you're looking for is in the System log...

# get a list of all server names, maybe from AD, we'll assume it's in a variable called $serverlist  
$eventIdToFind = "1234" # or whatever ID you're looking for
$logToSearch = "System"
foreach ($aServer in $serverlist) {  
  $theLog = New-Object System.Diagnostics.EventLog($logToSearch, $aServer)  
  $matchingEventList = $theLog.Entries | where { $_.EventId -eq $eventToFind }
  if ($null -ne $machingEventList -and $matchingEventList.Count -gt 0) {  
    "Event Found on $aServer" # or do something else with it here  
  }  
}  
Abs
  • 320
  • 3
  • 8