I want to delete critical error found in both application and system logs in event viewer.
I want this to be done every week, so I will be using task scheduler to perform this with a script.
I am having trouble deleting critical errors in event viewer. I am not sure which level option to include, as the Windows documentation for it does not specify how many levels are available, making this very vague.
I tried the following, but Powershell deletes all events in the application log (information, warning, and error): wevtutil qe Application /q:"*[System[(Level=2)]]" /f:txt | wevtutil cl Application.
I have also come across this Serverfault post from 2009, but it did not give an answer nor did it state if it could be done in Powershell to create a task out of it:
How can I remove specific events from the event log in Windows Server 2008?