Author | Chrissy LeMaire (@cl), netnerds.net |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Stop-DbaPfDataCollectorSet on GitHub.
Want to see the Bill Of Health for this command? Check out Stop-DbaPfDataCollectorSet.
Stops Windows Performance Monitor Data Collector Sets used for SQL Server performance monitoring.
Stops running Performance Monitor Data Collector Sets that are actively collecting performance counters for SQL Server monitoring and analysis. This function interacts with the Windows Performance Logs and Alerts (PLA) service to gracefully halt data collection processes. Commonly used to stop baseline data collection after capturing sufficient performance metrics, or to halt monitoring during maintenance windows when counter data isn't needed.
Stop-DbaPfDataCollectorSet
[[-ComputerName] <DbaInstanceParameter[]>]
[[-Credential] <PSCredential>]
[[-CollectorSet] <String[]>]
[[-InputObject] <Object[]>]
[-NoWait]
[-EnableException]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
PS C:\> Stop-DbaPfDataCollectorSet
Attempts to stop all ready Collectors on localhost.
PS C:\> Stop-DbaPfDataCollectorSet -ComputerName sql2017
Attempts to stop all ready Collectors on localhost.
PS C:\> Stop-DbaPfDataCollectorSet -ComputerName sql2017, sql2016 -Credential ad\sqldba -CollectorSet 'System Correlation'
Stops the 'System Correlation' Collector on sql2017 and sql2016 using alternative credentials.
PS C:\> Get-DbaPfDataCollectorSet -CollectorSet 'System Correlation' | Stop-DbaPfDataCollectorSet
Stops the 'System Correlation' Collector.
Specifies the target computer where Performance Monitor Data Collector Sets are running. Accepts multiple computer names for bulk operations.
Use this when stopping collectors on remote SQL Server instances or when managing multiple servers from a central location.
Defaults to localhost when not specified.
Alias | |
Required | False |
Pipeline | false |
Default Value | $env:COMPUTERNAME |
Allows you to login to $ComputerName using alternative credentials. To use:
$cred = Get-Credential, then pass $cred object to the -Credential parameter.
Alias | |
Required | False |
Pipeline | false |
Default Value |
Specifies the exact name of the Data Collector Set to stop. Supports multiple collector names for stopping several sets simultaneously.
Use this when you need to stop specific performance monitoring sets without affecting other running collectors on the system.
Common SQL Server collector sets include 'SQL Server Data Collector Set' and custom monitoring configurations.
Alias | DataCollectorSet |
Required | False |
Pipeline | false |
Default Value |
Accepts Data Collector Set objects from Get-DbaPfDataCollectorSet via pipeline input.
Use this approach when you need to filter or examine collector properties before stopping them, or when building complex monitoring workflows.
Alias | |
Required | False |
Pipeline | true (ByValue) |
Default Value |
Returns control immediately after initiating the stop command without waiting for the collector to fully terminate.
Use this in automated scripts where you need to stop multiple collectors quickly or when the stopping process might take time due to large data buffers being flushed.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
If this switch is enabled, no actions are performed but informational messages will be displayed that explain what would happen if the command were to run.
Alias | wi |
Required | False |
Pipeline | false |
Default Value |
If this switch is enabled, you will be prompted for confirmation before executing any operations that change state.
Alias | cf |
Required | False |
Pipeline | false |
Default Value |