Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $getEventLog = Get-EventLog -log application -ComputerName "myRemoteName" -after ((get-date).addMinutes($minutes*-1)) -EntryType Error
- Write-Host Get-Eventlog completed
- # list of events to exclude (based on text found in the message)
- $getEventLogFiltered = $getEventLog | Where-Object {$_.Message -notlike 'Monitis*' -and $_.Message -notlike '*MQQueueDepthMonitor.exe*' -and $_.Message -notlike '*The local computer may not have the necessary registry*' }
- #to only select certain columns, use Select-Object -Property and list the property/columns
- $getEventLogColumns = $getEventLogFiltered | Select-Object -Property TimeGenerated,Source,Message,EntryType,MachineName,EventID
- $tableFragment = $getEventLogColumns | ConvertTo-Html -fragment
- Write-Host "HTML-Table Built"
- Updates 03/04/2014 13:40 CT:
- Running with $minutes = 120 ran 14.5 minutes.
- Running with $minutes = 1 ran 12.5 minutes.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement