Added scripts

This commit is contained in:
Tobias Rydh
2023-05-23 17:02:39 +02:00
parent e6cdde5ad7
commit 6e544a16d2
6 changed files with 181 additions and 0 deletions

View 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