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


Remove-DbaPfDataCollectorSet

Removes a Performance Monitor Data Collector Set. When removing data collector sets from the local instance, Run As Admin is required.

Screenshots

dbatools-Remove-DbaPfDataCollectorSet

Examples

Prompts for confirmation then removes all ready Collectors on localhost.

Remove-DbaPfDataCollectorSet

Attempts to remove all ready Collectors on localhost and does not prompt to confirm.

Remove-DbaPfDataCollectorSet -ComputerName sql2017 -Confirm:$false

Prompts for confirmation then removes the ‘System Correlation’ Collector on sql2017 and sql2016 using alternative credentials.

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

Removes the ‘System Correlation’ Collector.

Get-DbaPfDataCollectorSet -CollectorSet ‘System Correlation’ | Remove-DbaPfDataCollectorSet

Stops and removes the ‘System Correlation’ Collector.

Get-DbaPfDataCollectorSet -CollectorSet ‘System Correlation’ | Stop-DbaPfDataCollectorSet | Remove-DbaPfDataCollectorSet

Author

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

Get-Help

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

Source Code

Want to see the source code? View Remove-DbaPfDataCollectorSet.ps1 on GitHub
 

Related commands