$source = "MySuperSpecialEventLog"
import-module ActiveDirectory
$servers = Get-ADComputer -Filter {OperatingSystem -Like "Windows Server*"} | % { $_.Name }
$servers | % {
Try {
$eventlog = get-eventlog -Source $source -ComputerName $_ -newest 1 -ErrorAction Stop
Write-Host $_ , ":", "has $source entries"
} Catch {
Write-Host $_ , ":", $_.Exception.Message
}
}
Isso faria eco de computer : has MySuperSpecialEventLog entries
ou computer : exceptionmessage