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?
Use the EventLogSession.GetProviderNames method like this:
EventLogSession session = new EventLogSession();
var providers = session.GetProviderNames().ToList();