Book Image

Windows Server 2016 Automation with PowerShell Cookbook - Second Edition

By : Thomas Lee, Ed Goad
Book Image

Windows Server 2016 Automation with PowerShell Cookbook - Second Edition

By: Thomas Lee, Ed Goad

Overview of this book

This book showcases several ways that Windows administrators can use to automate and streamline their job. You'll start with the PowerShell and Windows Server fundamentals, where you'll become well versed with PowerShell and Windows Server features. In the next module, Core Windows Server 2016, you'll implement Nano Server, manage Windows updates, and implement troubleshooting and server inventories. You'll then move on to the Networking module, where you'll manage Windows network services and network shares. The last module covers Azure and DSC, where you will use Azure on PowerShell and DSC to easily maintain Windows servers.
Table of Contents (21 chapters)
Title Page
Credits
About the Author
Acknowledgment
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Explore performance counters using CIM cmdlets


Another way to access performance information is via WMI. You can use either the WMI or the CIM cmdlets to access a large number of performance counters, as an alternative to using Get-Counter. The naming structure is different from using Get-Counter. With WMI, each counter is a separate WMI class.

With WMI, each performance counter set is a WMI class. The WMI performance counters are found in the ROOT\CimV2 namespace and have a name that begins with Win32_Perf. For example, the Memory performance counter set contains 36 separate counters. The WMI class Win32_PerfFormattedData_PerfOS_Memory contains 46 properties including all of the individual performance counters. With WMI, you get all the measurements back in one call to Get-CimInstance, whereas you would need to call Get-Counter for each sample. There are other ways to collect counters as shown in later recipes.

In this recipe, you get performance counters from local and remote machines using...