Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27203

VS 2012 Accessing extended event/application and service logs from VB.NET 2012

$
0
0
In the new versions of server 2008+ MS have added an "Application and Services" folder to Event Viewer,

I dont seem to be able to programaticaly access any logs in here,

My Code:
Code:

    Dim strValue As String
    Dim objLogs() As EventLog
    Dim Logname As String = "Microsoft-Windows-Backup"
    Dim objEntry As EventLogEntry
    Dim objLog As EventLog
    objLogs = EventLog.GetEventLogs()
    For Each objLog In objLogs
    If objLog.LogDisplayName = Logname Then Exit For
    Next
    For Each entry In objLog.Entries
    msgbox(entry.message)
    Next

If you set the Logname to "Application" or "System" everything works OK, but I can't access any of the new Extended logs

With regards to a solution, I dont care how i get the information out of this event log. (I thought about just opening the file "%SystemRoot%\System32\Winevt\Logs\Microsoft-Windows-Backup.evtx")

I have had the usual google but can't find anything that actually works.
(Please don't just point me to the MSDN article about access the Event log, it doesn't work for the extended logs)

Thanks in advance.

Viewing all articles
Browse latest Browse all 27203

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>