Created
September 23, 2023 14:04
-
-
Save rossarioking/a5fe472e63e4e5fa16a6f067bf6dbd26 to your computer and use it in GitHub Desktop.
Monitoring Event Log for Specific Events With Powershell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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