Managing and monitoring services
One of the 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...
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*
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'}
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-MailboxServer | ForEach-Object { Get-Service *exch...