dbatools is a free PowerShell module with over 300 SQL Server administration, best practice and migration commands included.

Please note that documentation and command names may be out of date while we work furiously towards 1.0


Gets Performance Counters.




Gets all counters for all Collector Sets on localhost.


Gets all counters for all Collector Sets on on sql2017.

Get-DbaPfDataCollectorCounter -ComputerName sql2017

Gets the ‘\Processor(_Total)\% Processor Time’ counter on sql2017.

Get-DbaPfDataCollectorCounter -ComputerName sql2017 -Counter ‘\Processor(_Total)\% Processor Time’

Gets all counters for the ‘System Correlation’ CollectorSet on sql2017 and sql2016 using alternative credentials.

Get-DbaPfDataCollectorCounter -ComputerName sql2017, sql2016 -Credential (Get-Credential) -CollectorSet ‘System Correlation’

Gets all counters for the ‘System Correlation’ CollectorSet.

Get-DbaPfDataCollectorSet -CollectorSet ‘System Correlation’ | Get-DbaPfDataCollector | Get-DbaPfDataCollectorCounter


This command was created by Chrissy LeMaire. You can find Chrissy on Twitter.


From PowerShell, execute Get-Help Get-DbaPfDataCollectorCounter -Detailed for more information on this function.

Source Code

Want to see the source code? View Get-DbaPfDataCollectorCounter.ps1 on GitHub

Related commands