It is always good to have a periodic check of the component status of the Configuration Manager components. The following code demonstrates how to get Configuration Manager components by querying WMI using PowerShell. To simplify the code, we will display the output on the console. However, in real-time practices, we usually capture the output in a reporting file. The following code will look for all the installed Configuration Manager components and verify the health of each component. The code will query the WMI for the SMS_ComponentSummarizer
class to get the status of the site components:
$TallyInterval = "0001128000080008" #Since site installation $CentralSiteCode = "ABC" $CentralSiteProvider = "SCCMCAS" $ComputersWithIssues = Get-WmiObject -Namespace root\sms\Site_$CentralSiteCode -query "Select * from SMS_ComponentSummarizer where Status <> 0 AND TallyInterval = '$TallyInterval'" -ComputerName $CentralSiteProvider...