14

I have selected the Enable All Tasks History option in the Task Scheduler Library of Windows Server 2008 R2.

For most tasks, I’d like to have the history kept but I’m wondering if it’s possible to disable the history for some tasks (non-critical and frequent) and not others?

  • 1
    Or conversely, keep it disabled for all tasks and only enable it for some. – Synetech Aug 21 '12 at 15:06
  • 3
    I don't think it is possible however.; It looks like you can use a bug to get this functionality. Add an ampersand to the task name and I believe it will not show up in history. [See here.][1] [1]: stackoverflow.com/a/33786418/2184401 – Brett Larson Nov 8 '16 at 5:57
  • Hello, since you posted the question did you find any way to disable logging for one/enable only it for a few ? I was wondering exactly the same thing for logging purpose, because I have a task running every two minutes which I would like to avoid to view in event log. Thank you ! – AFract Aug 29 '17 at 10:15
1

It doesn't look like there's a good way filter this like you are thinking of, but you could add a couple actions to your task to disable logging first, enable it after.

There is a chance that there is another scheduled task trying to write to the log at that time, so you would need to be okay with some potential logging loss on that end.

See below script from here

$logName = 'Microsoft-Windows-TaskScheduler/Operational'

$log = New-Object System.Diagnostics.Eventing.Reader.EventLogConfiguration

$logName

$log.IsEnabled=$true

$log.SaveChanges()

The only other way I can think of doing this is disabling it across the board and then for the events you want logging you could log manually by encapsulating your actual commands in a powershell script or something of the like that writes all output to text or even to a custom event log.

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.