Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rossarioking/a5fe472e63e4e5fa16a6f067bf6dbd26 to your computer and use it in GitHub Desktop.
Save rossarioking/a5fe472e63e4e5fa16a6f067bf6dbd26 to your computer and use it in GitHub Desktop.
Monitoring Event Log for Specific Events With Powershell
This script monitors the Application log for a specific event ID (e.g., 1001).
These are just a few examples of how you can use PowerShell for system monitoring. You can customize these scripts further based on your specific monitoring needs and create scheduled tasks to run them regularly. Additionally, consider using PowerShell modules like PRTG, Nagios, or others for more comprehensive monitoring solutions.
Get-EventLog -LogName Application | Where-Object { $_.EventID -eq 1001 } | ForEach-Object {
Write-Host "Event 1001 detected: $($_.Message)"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment