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

Managing and monitoring services


One of most critical aspects of server monitoring requires you to keep an eye on all of the Exchange services that need to be running to ensure the application is online and servicing end users. In this recipe, we'll take a look at how to monitor and manage both Windows operating system services and Exchange Server specific services.

How to do it...

  1. One of the ways we can monitor the state of one or more services is using the PowerShell core cmdlets. For example, to view all Exchange-related services, run the following command:

    Get-Service *exch*
  2. To view only the Exchange-related services that are currently running, pipe the previous command to Where-Object and filter the results:

    Get-Service *exch* | Where-Object {$_.Status -eq 'Running'}
  3. The Get-Service cmdlet can be run against remote machines as well. The following example retrieves the services from every Exchange server in the organization:

    Get-ExchangeServer | ForEach-Object {
      Get-Service *exch* -ComputerName...