Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Get-EventLog -after is slow

378 views
Skip to first unread message

l33t

unread,
Jul 16, 2010, 12:29:28 PM7/16/10
to
Hi all..

I'm using the Get-EventLog -After (Get-Date).AddHours(-24) command.
Some machines it runs relatively quick (2-3min) while others it hangs
for a long time. It's like PS is looking at the entire log...not
sure.

Anyone know of a faster way to query the past days events?

Thanks,
Danny

jason.s....@gmail.com

unread,
Jul 23, 2014, 10:08:38 AM7/23/14
to
Get-EventLog actually gets the whole log before it parses the date. Use Get-WinEvent. Performance is a lot better.

Get-WinEvent -FilterHashtable @{LogName='System'; StartTime=(Get-Date).AddHours(-1)}

Thanks,
Jason
0 new messages