Added scripts
This commit is contained in:
12
PowerShell/get-eventid.ps1
Normal file
12
PowerShell/get-eventid.ps1
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
$server = 127.0.0.1
|
||||
$starttime = get-date -Format yyyy-MM-dd
|
||||
|
||||
Get-EventLog Application -ComputerName $server -After $starttime |
|
||||
? { $_.entryType -Match "Error" -and "Critical" } |
|
||||
Group-Object -Property EventID |
|
||||
% { $_.Group[0] | Add-Member -PassThru -NotePropertyName Count -NotePropertyValue $_.Count } |
|
||||
Sort-Object EventID -Unique |
|
||||
Select-Object Count, TimeGenerated, EventID, Source, Message |
|
||||
ft -AutoSize -Wrap |
|
||||
Out-File $file -Append
|
||||
Reference in New Issue
Block a user