Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Microsoft System Center Powershell Essentials

You're reading from  Microsoft System Center Powershell Essentials

Product type Book
Published in Apr 2015
Publisher Packt
ISBN-13 9781784397142
Pages 140 pages
Edition 1st Edition
Languages

Table of Contents (15) Chapters

Microsoft System Center PowerShell Essentials
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
1. Setting up the Environment to Use PowerShell 2. Administration of Configuration Manager through PowerShell 3. Scenario-based Scripting for SCCM Administration 4. Administration of Operations Manager through PowerShell 5. Scenario-based Scripting for SCOM Administration 6. Administration of Service Manager through PowerShell 7. Scenario-based Scripting for SCSM Administration 8. Best Practices Index

Scenario 9 – getting component status in Configuration Manager


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...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime}