-1

I would like to get all the provider names of Event Viewer using C#. Please see below the sample provider

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
  <Provider Name="Microsoft-Team Foundation Server" Guid="{80761876-6844-47D5-8106-F8ED2AA8687B}" />!`<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
  <Provider Name="Microsoft-Team Foundation Server" Guid="{80761876-6844-47D5-8106-F8ED2AA8687B}" />

How can I get these providers list?

Liam
  • 27,717
  • 28
  • 128
  • 190

1 Answers1

1

Use the EventLogSession.GetProviderNames method like this:

EventLogSession session = new EventLogSession();

var providers = session.GetProviderNames().ToList();
Yacoub Massad
  • 27,509
  • 2
  • 36
  • 62
  • Hi @KaleemUddinMohammedAbdul. If this answer has solved your question, please consider [accepting it](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both me and yourself. – Yacoub Massad Dec 16 '15 at 23:26
  • 1
    Thanks Yacoub.. I am very new to Stackoverflow.. I'm in the process of learning! I did clicked on the check-mark! – KaleemUddin Mohammed Abdul Dec 17 '15 at 20:19