O'Reilly logo

Windows PowerShell™ Scripting Guide by Ed Wilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Managing the Event Log

There are many components to manage when working with event logs. Probably the most important is the size of the log file. You want a log file that is large enough to contain the pertinent history of a particular system event, but not so large that it is cumbersome to work with.

Identifying the Sources

When working with event logs, it is important to know which log is being used for logging purposes. To identify this information, you need to determine the registered sources for the event log. An easy way to determine the sources for the event log is to use the WMI class Win32_NtEventLogFile. This is exactly what we do in the GetLogSources.ps1 script. We first define the $strLog variable, and assign the name of an event log ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required