Get-DbaPfDataCollectorSet
View SourceSynopsis
Retrieves Windows Performance Monitor Data Collector Sets and their configuration details.
Description
Retrieves detailed information about Windows Performance Monitor Data Collector Sets, which are used to collect performance counters for SQL Server monitoring and troubleshooting. Data Collector Sets define what performance counters to collect, when to collect them, and where to store the collected data. This function helps DBAs inventory existing collector sets, check their status (running, stopped, scheduled), and review their configuration including output locations and schedules. Particularly useful when inheriting a SQL Server environment or auditing existing performance monitoring setup.
Syntax
Get-DbaPfDataCollectorSet
[[-ComputerName] <DbaInstanceParameter[]>]
[[-Credential] <PSCredential>]
[[-CollectorSet] <String[]>]
[-EnableException]
[<CommonParameters>]
Examples
Example: 1
PS C:\> Get-DbaPfDataCollectorSet
Gets all Collector Sets on localhost.
Example: 2
PS C:\> Get-DbaPfDataCollectorSet -ComputerName sql2017
Gets all Collector Sets on sql2017.
Example: 3
PS C:\> Get-DbaPfDataCollectorSet -ComputerName sql2017 -Credential ad\sqldba -CollectorSet 'System Correlation'
Gets the ‘System Correlation’ CollectorSet on sql2017 using alternative credentials.
Example: 4
PS C:\> Get-DbaPfDataCollectorSet | Select-Object *
Displays extra columns and also exposes the original COM object in DataCollectorSetObject.
Optional Parameters
-ComputerName
Specifies the Windows server(s) where you want to inventory Performance Monitor Data Collector Sets.
Use this when checking collector sets across multiple SQL Server hosts or when managing performance monitoring from a central location.
Accepts multiple computer names and defaults to the local computer.
| Property | Value |
|---|---|
| Alias | |
| Required | False |
| Pipeline | true (ByValue) |
| Default Value | $env:COMPUTERNAME |
-Credential
Allows you to login to servers using alternative credentials. To use:
$scred = Get-Credential, then pass $scred object to the -Credential parameter.
| Property | Value |
|---|---|
| Alias | |
| Required | False |
| Pipeline | false |
| Default Value |
-CollectorSet
Specifies the name(s) of specific Data Collector Sets to retrieve instead of returning all collector sets.
Use this when you need to check the status or configuration of specific performance monitoring setups like ‘SQL Server Default’ or custom collector sets.
Accepts wildcards and multiple collector set names for targeted monitoring inventory.
| Property | Value |
|---|---|
| Alias | DataCollectorSet |
| Required | False |
| Pipeline | false |
| Default Value |
-EnableException
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.
| Property | Value |
|---|---|
| Alias | |
| Required | False |
| Pipeline | false |
| Default Value | False |
Outputs
PSCustomObject
Returns one object per Data Collector Set found on the target computer(s).
Default display properties (via Select-DefaultView):
- ComputerName: The name of the computer where the Data Collector Set is configured
- Name: The name of the Data Collector Set
- DisplayName: The user-friendly display name of the collector set
- Description: Text description of what the collector set monitors
- State: Current state (Unknown, Disabled, Queued, Ready, Running)
- Duration: Duration in seconds for which the collector set will run
- OutputLocation: File system path where collected data is stored
- LatestOutputLocation: Path to the most recently collected output files
- RootPath: Root directory path for the collector set configuration
- SchedulesEnabled: Boolean indicating if schedules are enabled
- Segment: Segment configuration value for data collection
- SegmentMaxDuration: Maximum duration in seconds for a collection segment
- SegmentMaxSize: Maximum size in MB for a collection segment
- SerialNumber: Serial number or identifier for the collector set
- Server: Name of the server hosting the collector set
- StopOnCompletion: Boolean indicating if the collector set stops automatically when complete
- Subdirectory: Subdirectory path for organizing collector set output
- SubdirectoryFormat: Format pattern for subdirectory naming
- SubdirectoryFormatPattern: Detailed format pattern specification
- Task: Name of the Windows Task Scheduler task associated with the collector set
- TaskArguments: Command-line arguments passed to the collector set task
- TaskRunAsSelf: Boolean indicating if the task runs under the specified user account
- TaskUserTextArguments: User-specified text arguments for the task
- UserAccount: Windows user account under which the collector set runs
*Additional properties available (via Select-Object ):
- Keywords: Keywords associated with the collector set for searching/categorizing
- DescriptionUnresolved: Raw description text before localization/resolution
- DisplayNameUnresolved: Raw display name before localization/resolution
- Schedules: Collection of schedule objects for the collector set
- Xml: Raw XML configuration of the collector set
- Security: Security descriptor for the collector set
- DataCollectorSetObject: Boolean indicating the object came from a Data Collector Set COM object
- TaskObject: Reference to the underlying Task Scheduler COM object
- Credential: The credentials used to retrieve this collector set
dbatools