

Get-Counter -Counter "\Memory\Available MBytes" Get-Counter -Counter "\Processor(*)\% Interrupt Time" Get-Counter -Counter "\Processor(*)\% DPC Time" Get-Counter -Counter "\Processor(*)\% Privileged Time" Get-Counter -Counter "\Processor(*)\DPCs Queued/sec" Get-Counter -Counter "\System\Processor Queue Length" Get-Counter -Counter "\Thread(_Total)\Context Switches/sec" Get-Counter -Counter "\Processor(*)\% Processor Time" If you’re unsure of a property name, you can retrieve a list of all properties by class with the following: (Get-Counter -ListSet ).Pathsįor example, this command will display all of the properties of the Memory class: (Get-Counter -ListSet Memory).Paths Part of the, er, power of collecting metrics with Powershell is that you can choose between real-time performance data for spot-checking, or sampling metric values over time for historical trending (by using the -MaxSamples and -SampleInterval command line arguments).Ĭollecting performance metrics with Powershell using the Get-Counter cmdlet follows a straightforward syntax: Get-Counter -Counter \ A Powershell tutorial is beyond the scope of this article, but Microsoft has tutorials for the uninitiated.Īll of the metrics and events listed in part one of this series can be collected with Powershell: For example, Remove-Item is functionally similar to rm on Unix-like systems. Powershell commands are referred to as cmdlets, and follow a strict Verb-Noun naming convention. Powershell is one of the most dynamic and powerful ways to get information about a Windows system (and, with Powershell available on other platforms, other systems as well).

In many cases, Windows offers more than one tool for the task.

Windows offers a number of native tools to collect all of the metrics and events mentioned in part 1 of this series. For an in-depth webinar and Q&A session based on this series, check out this slide deck and video. Part 1 details key Windows performance counters, events, and services to monitor this post covers data collection with native tools and Part 3 explains how to monitor Windows with Datadog. This post is part 2 of a 3-part series on monitoring the health and performance of the Windows operating system.
