Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

get-winevent - multiple pc's

$
0
0

Is there a easy way to export the results from the below script to csv file?

Thank you..


$yesterday = (get-date) - (new-timespan -day 5)
$servers = get-content c:\temp\pc.txt
foreach ($server in $servers)
{
Get-WinEvent -ComputerName $server -MaxEvents 1 -FilterHashTable @{LogName='Application'; StartTime=$yesterday; ID=8200 } -ErrorAction SilentlyContinue   | Select-Object MachineName,TimeCreated,Id,Message 
}
   


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>