Databases Reference
In-Depth Information
Figure 8-9
The SQL Server-specific error messages are shown in Figure 8-10.
Figure 8-10
You can also filter events based on date ranges. The following example uses the Where-Object cmdlet
to filter the events whose TimeGenerated property is greater than 20081130 (Nov 30, 2008) and less than
20081201 (Dec 1, 2008), thus getting the error events that occurred on Nov 30, 2008. Then the events are
sorted in descending order by time, and displayed in a list:
Get-WmiObject -namespace root\CIMV2 -class Win32_NTLogEvent -Filter
"LogFile = 'Application'" | Where-Object { ($_.EventType -eq 1) -and ($_.TimeGenerated
-gt "20081130") -and ($_.TimeGenerated -lt "20081201") } | Sort-Object
TimeGenerated -descending | Format-List
Figure 8-11 shows the events generated on Nov 30, 2008.
Search WWH ::




Custom Search