Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Windows Server 2019 Automation with PowerShell Cookbook

You're reading from   Windows Server 2019 Automation with PowerShell Cookbook Powerful ways to automate and manage Windows administrative tasks

Arrow left icon
Product type Paperback
Published in Feb 2019
Publisher Packt
ISBN-13 9781789808537
Length 542 pages
Edition 3rd Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Thomas Lee Thomas Lee
Author Profile Icon Thomas Lee
Thomas Lee
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Establishing a PowerShell Administrative Environment FREE CHAPTER 2. Managing Windows Networking 3. Managing Windows Active Directory 4. Managing Windows Storage 5. Managing Shared Data 6. Managing Windows Update 7. Managing Printing 8. Introducing Containers 9. Managing Windows Internet Information Server 10. Managing Desired State Configuration 11. Managing Hyper-V 12. Managing Azure 13. Managing Performance and Usage 14. Troubleshooting Windows Server Index

Retrieving performance counters using Get-Counter

Within Windows, a performance counter set is a set of performance counters. Each counter in a counter set measures an aspect of your system related to that counter set. In this recipe, we explore counter sets and counters on several servers.

Getting ready

This recipe uses DC1, DC2, SRV1, SRV2, HV1, and HV2. These are servers that you have worked with in various recipes in this book. DC1 and DC2 are domain controllers, HV1 and HV2 host Hyper-V, and SRV1 and SRV2 are general-purpose Windows servers. All of these systems are running Windows 2019 Datacenter edition. Run this recipe from SRV1.

How to do it...

  1. Discover performance counter sets on SRV1:
    $CounterSets = Get-Counter -ListSet *
    $CS1 = 'There are {0} counter sets on [{1}]'
    $CS1 -f $CounterSets.Count,(hostname)
  2. Discover performance counter sets on remote systems:
    $Machines = 'DC1','DC2','HV1','HV2','SRV1','SRV2'
    Foreach ...
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 £16.99/month. Cancel anytime