Can someone advise on how to approach this?
i have some code that works fine.
$Clients = (Get-QADComputer -SearchRoot "abc.forest.org/myou").name $Range = (get-date) - (new-timespan -hour 48) $errors = @() foreach ($Computer in $Clients){ if (Test-Connection $Computer -Count 1 -ErrorAction SilentlyContinue){ write-host $Computer Getting Errors; $errors += Get-Winevent -ea SilentlyContinue -ComputerName $computer -FilterHashtable @{LogName="System"; Level=1,2; startTime=$Range} }else{ write-host $Computer Failed ping } } $errors
However i lose what computer the error comes from.
Any advice?