How it works...

The Get-Counter cmdlet is the tool you use both to discover the performance counter sets and counters, as well as, to get specific the counter samples. In step 1, you get all the performance counter sets on the local system and display the results. The results you obtain vary depending on the specific features you install on your computers. On the SRV1 VM, step 1 looked like this:

In step 2, you expand the scope a bit to return the number of counter sets in multiple machines in the network. The domain controllers and other servers have different features loaded. Therefore you see different number of counter sets on each machine: ...

Get Windows Server 2016 Automation with PowerShell Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.