The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

PowerShell: count the Windows EventLog entries for Applications over the last 10 minutes

Posted by jpluimers on 2019/09/25

In production, somehow an application started to misbehave, so would spit out a lot of Windows EventLog entries for Applications you can see in the EventViewer. This small script helped counting it (it takes about 10 seconds on a log having a total of 77k entries):

$tenMinutes = New-TimeSpan -Minutes 10
$now = Get-Date
$tenMinutesAgo = $now - $tenMinutes
$eventLogEntries = Get-EventLog -After $tenMinutesAgo -LogName "Application"
$count = ($eventLogEntries | Measure-Object).Count
Write-Host $count

Related:

–jeroen

One Response to “PowerShell: count the Windows EventLog entries for Applications over the last 10 minutes”

  1. Ruurd's avatar

    Ruurd said

    I don’t know who came up with this shit…

Leave a reply to Ruurd Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.