Powershell 2 - Get-WinEvent -FilterXML

243 Views Asked by At

Hello Powershell experts,

I am trying to accomplish the following. Get the windows application log in past 30 minutes that includes the following in the log message. "Error in connection"

I am not familiar with Powershell and have searched around and using -FilterXML looks the fastest solution, however, I could not complete the syntax where it search for "Error in connection" from the error log.

This is what I have. Please advise how I can add the part where it needs to look for "Error in connection" errors only.

Get-WinEvent -ComputerName $dest -FilterXML "<QueryList>
<Query>
    <Select Path='system'>*[System[Level=2 and TimeCreated[timediff(@SystemTime)&lt;= 1440000]]]</Select>
</Query></QueryList>"

Thank you in advance for your help.

0

There are 0 best solutions below