Reader small image

You're reading from  Windows Server 2016 Automation with PowerShell Cookbook - Second Edition

Product typeBook
Published inSep 2017
Reading LevelBeginner
Publisher
ISBN-139781787122048
Edition2nd Edition
Languages
Right arrow
Authors (2):
Thomas Lee
Thomas Lee
author image
Thomas Lee

Thomas Lee is a consultant/trainer/writer based in the UK and has been in the IT business since the late 1960s. After graduating from Carnegie Mellon University, Thomas joined ComShare where he was a systems programmer building the Commander II time-sharing operating system, a forerunner of today's cloud computing paradigm. In the mid-1970s, he moved to ICL to work on the VME/K operating system. After a sabbatical in 1980/81, he joined Accenture, leaving in 1988 to run his own consulting and training business, which is still active today. Thomas holds numerous Microsoft certifications, including MCSE (one of the first in the world) and later versions, MCT (25 years), and was awarded Microsoft's MVP award 17 times.
Read more about Thomas Lee

 Ed Goad
Ed Goad
author image
Ed Goad

Ed Goad is a systems architect who has been working in various roles in the IT field for 16 years. He first became interested in scripting and automation when presented with a task to uninstall software from over 1,000 systems with limited time and resources. He has worked with scripting and automation on multiple platforms and languages including PowerShell, VBscript, C#, and BASH scripting. Ed currently holds multiple Microsoft certifications, most recently including the Microsoft Certified IT Professional Enterprise Administrator. Additional non-Microsoft certifications include VMware Certified Professional (VCP), Red Hat Certified System Administrator (RHCSA), EMC Proven Professional, Brocade Certified Network Engineer (BCNE), and Cisco Certified Network Associate (CCNA). Ed is currently on a sabbatical and volunteering full time at the Amor Fe y Esperanza school in Honduras(http://www.afehonduras.org). There he is teaching computer and math classes to the kids who live and work in the garbage dump outside of the capital city of Tegucigalpa.
Read more about Ed Goad

View More author details
Right arrow

Explore performance counters with Get-Counter


Get-Counter is the cmdlet you use both to discover the counter sets available on a machine, and to obtain performance samples from a local or remote server. In this recipe, you use a Windows Server 2016 server, SRV1, to examine performance counter sets and counters on local and remote computers.

Getting ready

This recipe uses several remote machines: DC1, CA, SRV1, FS1, FS2, and PSRV. Adjust the recipe to reflect the computers in your testing or production environment.

This recipe uses several servers to simulate a normal organization. Consider using fewer servers.

How to do it...

  1. You start by using Get-Counter to discover performance counter sets on the local machine:
$CounterSets = Get-Counter -ListSet *  "There are {0} counter sets on [{1}]" `
                                   -f $CounterSets.count, (hostname)
  1. Discover performance counter sets on remote systems:
$Machines = 'DC1', 'CAa', 'SRV1', 'FS1', 'FS2', 'PSRV' foreach ($Machine in $Machines...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Windows Server 2016 Automation with PowerShell Cookbook - Second Edition
Published in: Sep 2017Publisher: ISBN-13: 9781787122048

Authors (2)

author image
Thomas Lee

Thomas Lee is a consultant/trainer/writer based in the UK and has been in the IT business since the late 1960s. After graduating from Carnegie Mellon University, Thomas joined ComShare where he was a systems programmer building the Commander II time-sharing operating system, a forerunner of today's cloud computing paradigm. In the mid-1970s, he moved to ICL to work on the VME/K operating system. After a sabbatical in 1980/81, he joined Accenture, leaving in 1988 to run his own consulting and training business, which is still active today. Thomas holds numerous Microsoft certifications, including MCSE (one of the first in the world) and later versions, MCT (25 years), and was awarded Microsoft's MVP award 17 times.
Read more about Thomas Lee

author image
Ed Goad

Ed Goad is a systems architect who has been working in various roles in the IT field for 16 years. He first became interested in scripting and automation when presented with a task to uninstall software from over 1,000 systems with limited time and resources. He has worked with scripting and automation on multiple platforms and languages including PowerShell, VBscript, C#, and BASH scripting. Ed currently holds multiple Microsoft certifications, most recently including the Microsoft Certified IT Professional Enterprise Administrator. Additional non-Microsoft certifications include VMware Certified Professional (VCP), Red Hat Certified System Administrator (RHCSA), EMC Proven Professional, Brocade Certified Network Engineer (BCNE), and Cisco Certified Network Associate (CCNA). Ed is currently on a sabbatical and volunteering full time at the Amor Fe y Esperanza school in Honduras(http://www.afehonduras.org). There he is teaching computer and math classes to the kids who live and work in the garbage dump outside of the capital city of Tegucigalpa.
Read more about Ed Goad