Book Image

Microsoft Exchange 2010 PowerShell Cookbook

Book Image

Microsoft Exchange 2010 PowerShell Cookbook

Overview of this book

Table of Contents (22 chapters)
Microsoft Exchange 2010 PowerShell Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Working with the event logs


Detailed messages about informational events, warnings, and errors are logged in both the Windows event logs, and the Applications and Services event logs. The messages provide deep insight into what is going on with the operating system and your Exchange servers. In this recipe, you'll learn how PowerShell makes it easier than ever to monitor these logs using simple commands that can be used to troubleshoot issues and generate reports.

How to do it...

  1. To determine the available Windows logs that you can work with on a server, use the Get-EventLog cmdlet with the -List parameter:

  2. The names listed under the Log column are the log names you can use with the Get-EventLog cmdlet. For example, to view the events in the application log that were logged by Exchange, you could use the following command:

    Get-EventLog -LogName Application -Source *exch* -EntryType Error
  3. In addition to specifying the log name and the entry type, you can retrieve a specific number of log entries...