I am using SQL server 2008 Standard edition. I am using Policy based management with policies which come with SQL server during installation.

I want the policies to only look at events that happened in last 24 hours. For example for "Windows Event Log System Failure Error" policy if system restarted unexpectedly 5 days ago, i don't want to be alerted daily.

Is there any way by which I can restrict a policy to look at events which happened in last 24 hours not older?

Any help please?

Thanks in advance.



You will need to alter the condition on which that policy relies. In this case, the name of the condition is 'System Failure Error Check', and that condition is using the following WQL in order to grab the info:

IsNull(ExecuteWql('Numeric', 'root\CIMV2', 'select EventCode from Win32_NTLogEvent where EventCode=6008 and Logfile="System"'), 0)

If you alter this WQL, you should be able to further filter for events only in the past 24 hours.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.