How can I use EventLog
to read from an arbitrary evtx
file?
EventLogQuery
is able to open evtx
files, but it is not available in .NET 2.0.
How can I use EventLog
to read from an arbitrary evtx
file?
EventLogQuery
is able to open evtx
files, but it is not available in .NET 2.0.
Let's assume the log file is
LogA.evtx
.Copy
LogA.evtx
toC:\Windows\System32\winevt\Logs
.Add a new registry key to:
called
LogA
. E.g. in PowerShell:Open Event Viewer to verify that LogA shows up under Applications and Services Logs.
You can now open
LogA
usingEventLog
:You can delete
LogA
via PowerShell: