Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 3 down vote accepted

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.

share|improve this answer
    
This is the way to go if you have more than a few machines. Centralize that data and searching! –  Joe Doyle Apr 30 '09 at 15:14

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  
  }  
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.