$Log="System" $args | foreach-object { write-output "Client name: $_" $EventLog = new-Object System.Diagnostics.EventLog($Log, $_) $EventLog.entries | select -first 100 | where {$_.entryType -match "Error"} }