I wonder if someone can help with this.
I know how to read Windows events under Application, Security, System, etc. using c# .net core 6.0. But I can't read any Windows events under "Applications and Services Logs/Microsoft/Windows/Ntfs/Operational". Here is the code I use
var log = new EventLog("Application"); // This works fine
foreach( var entry in log.Entries)
{
// Do something with the event
System.Console.WriteLine("\tEntry: " + entry.ToString());
}
var log2 = new EventLog("Microsoft-Windows-Ntfs/Operational"); // This does not work
foreach( var entry in log2.Entries)
{
// Do something with the event
System.Console.WriteLine("\tEntry: " + entry.ToString());
}
I can query the events using this powershell command: Get-WinEvent -LogName "Microsoft-Windows-Ntfs/Operational" based on this thread - https://serverfault.com/questions/1067287/get-eventlog-log-microsoft-windows-ntfs-operational-fails-with-does-not-exis, but I need a way to read them in c# code.
Thanks.
Peter