Book Image

Microsoft System Center Powershell Essentials

Book Image

Microsoft System Center Powershell Essentials

Overview of this book

Table of Contents (15 chapters)
Microsoft System Center PowerShell Essentials
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
4
Administration of Operations Manager through PowerShell
Index

Listing all unhealthy SCOM agents


The following code lists all the SCOM agents that are not healthy for various reasons. We can use this report as a reference for further troubleshooting:

$AllAgents = Get-SCOMAgent
$UnHealthyAgents = $AllAgents | where {$_.HealthState -ne "Success"} | select Name,HealthState 
Write-Host "Unhealthy Agent list = `n $UnHealthyAgents"