This project has moved and is read-only. For the latest updates, please go here.

Event Logs and Task Scheduler Event Triggers

Topics: Errors
Feb 10, 2016 at 1:10 PM
I am trying to fetch a list of all logs and display them in dropdown for creating an Event Trigger. Just like Windows Task Scheduler does.

While I check with WTS, it shows me a certain list of Event Logs, which does not include "Debug & Analytic Logs"

However, when I try to get the list of logs using EventLogSession class, I get the complete list which include those "Debug & Event Logs" as well.

As a result, when the wrapper tries to create the task with such a trigger, it fails.

While its not directly something wrong with the Wrapper, I still feel I am missing some link here.

Do we have something in the wrapper that can be used to get the list of the Event Logs registered on the system.

Any help is greatly appreciated.

Thanks In Advance
Feb 10, 2016 at 7:00 PM
Please look at the source code for the EventTriggerUI.cs and the SystemEventEnumerator.cs and you will see how I've done it for my user interfaces.
Marked as answer by dahall on 2/10/2016 at 11:01 AM
Feb 11, 2016 at 3:22 AM
I have taken the cue out of SystemEventEnumerator class only and am actually using the same "GetEventLogs" method to get the String[] of Log Names.

The problem is that it returns extra log names that are not present in the Task Scheduler (On Event Trigger) Dropdown.
Feb 11, 2016 at 4:38 PM
Ah, yes. I ran across this problem too when developing my "copies" of the native code. I never did get to an answer as to why. Have to found anything that distinguishes those items shown by the native tool and not shown by GetEventLogs?