Chapter 6. Working with Event Logs

Chapter 5 discussed features related to navigating through the many different data stores in a consistent way. PowerShell also provides the functionality to access the event logs. This chapter discusses the various cmdlets related to accessing and handling event logs. As you know, the behaviors of hardware, software, and users on your system are recorded as events in the Windows event logs. Therefore, the event logs provide very helpful insight into what is happening on your system. For example, if your SQL Server doesn't start automatically as expected, then the Application event log would be the first place you want to look to troubleshoot the problem. However, the large volume of information contained in the event logs can sometimes make it difficult to find the particular events you are interested in.

This chapter introduces you to the available event logs and the different types of information they contain. It also shows you how to sift through the information more effectively with Windows PowerShell.

This chapter covers the following topics:

  • Event Log Service

  • Event Viewer

  • Event logs

  • Log entry types

  • Exporting the event logs

  • PowerShell cmdlets related to event logs

Event Log Service

The Windows Event Log service enables an application to publish, access, and process events. Events are stored in event logs, which can be routinely checked by an administrator or monitoring tool to detect certain occurrences or problems on a computer.

In Windows 2003 and ...

Get Microsoft® SQL Server® 2008 Administration with Windows PowerShell™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.