Merge pull request #329 from silversword411/develop
Adding Bluescreen script
This commit is contained in:
commit
4b84062d62
|
@ -229,5 +229,12 @@
|
|||
"name": "AD - Check and Enable AD Recycle Bin",
|
||||
"description": "Only run on Domain Controllers, checks for Active Directory Recycle Bin and enables if not already enabled",
|
||||
"shell": "powershell"
|
||||
},
|
||||
{
|
||||
"filename": "Check_Events_for_Bluescreens.ps1",
|
||||
"submittedBy": "https://github.com/dinger1986",
|
||||
"name": "Event Viewer - Check for Bluescreens",
|
||||
"description": "This will check for Bluescreen events on your system",
|
||||
"shell": "powershell"
|
||||
}
|
||||
]
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
# This will check for Bluescreen events on your system
|
||||
|
||||
$ErrorActionPreference= 'silentlycontinue'
|
||||
$TimeSpan = (Get-Date) - (New-TimeSpan -Day 1)
|
||||
|
||||
if (Get-WinEvent -FilterHashtable @{LogName='application';ID='1001';ProviderName='Windows Error Reporting';Level=4;Data='BlueScreen';StartTime=$TimeSpan})
|
||||
|
||||
{
|
||||
Write-Output "There has been bluescreen events detected on your system"
|
||||
Get-WinEvent -FilterHashtable @{LogName='application';ID='1001';ProviderName='Windows Error Reporting';Level=4;Data='BlueScreen';StartTime=$TimeSpan}
|
||||
exit 1
|
||||
}
|
||||
|
||||
{
|
||||
else
|
||||
Write-Output "No bluescreen events detected"
|
||||
exit 0
|
||||
}
|
||||
|
||||
Exit $LASTEXITCODE
|
Loading…
Reference in New Issue