Add-SPDiagnosticsPerformanceCounter
Adds a new instance of a performance counter to a Web front end computer or a database server.
Syntax
Add-SPDiagnosticsPerformanceCounter
[-Category] <String>
-Counter <String>
[-AllInstances]
[-AssignmentCollection <SPAssignmentCollection>]
[-Confirm]
[-DatabaseServer]
[-WebFrontEnd]
[-WhatIf]
[<CommonParameters>]
Add-SPDiagnosticsPerformanceCounter
[-Category] <String>
[-Counter <String>]
-Instance <String>
[-AllInstances]
[-AssignmentCollection <SPAssignmentCollection>]
[-Confirm]
[-DatabaseServer]
[-WebFrontEnd]
[-WhatIf]
[<CommonParameters>]
Add-SPDiagnosticsPerformanceCounter
[-Category] <String>
[-Instance <String>]
[-AllInstances]
[-AssignmentCollection <SPAssignmentCollection>]
[-Confirm]
[-DatabaseServer]
[-WebFrontEnd]
[-WhatIf]
-CounterList <String[]>
[<CommonParameters>]
Description
This cmdlet contains more than one parameter set. You may only use parameters from one parameter set, and you may not combine parameters from different parameter sets. For more information about how to use parameter sets, see Cmdlet parameter sets.
The Add-SPDiagnosticsPerformanceCounter cmdlet adds a performance counter to a front end Web server or a database server. A performance counter is read and recorded in the usage database. By default, the new performance counter is added to the database servers in the farm.
Examples
------------------EXAMPLE 1------------------
Add-SPDiagnosticsPerformanceCounter -category ASP.NET -Counter "Requests Queued"
This example adds the counter that has the name ASP.NET\Requests Queued on front end Web servers.
------------------EXAMPLE 2------------------
Add-SPDiagnosticsPerformanceCounter -category PhysicalDisk -counter "Avg. Disk Queue Length" -allinstances
This example adds all instances of the counter PhysicalDisk in the category Avg. Disk Queue Length on front end Web servers.
------------------EXAMPLE 3------------------
Add-SPDiagnosticsPerformanceCounter -category Processor -counter "% Processor Time" -instance "_Total" -databaseserver
This example adds the _Total instance of the counter % Processor Time in the category Processor on database servers.
Parameters
-AllInstances
Collects all instances of a counter category and type on the target Web front end computer or database server.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server Subscription Edition |
-AssignmentCollection
Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.
Type: | SPAssignmentCollection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server Subscription Edition |
-Category
Specifies the category of performance counter to add to the target Web front end computer or database server.
The type must be a valid name of a category of performance counters; for example, ASP.NET, PhysicalDisk, or Processor.
Type: | String |
Position: | 2 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server Subscription Edition |
-Confirm
Prompts you for confirmation before executing the command.
For more information, type the following command: get-help about_commonparameters
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server Subscription Edition |
-Counter
Specifies the type of counter to add to the target Web front end computer or database server.
The type must be a valid name of counter type; for example, Requests Queued, Avg. Disk Queue Length, and % Processor Time.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server Subscription Edition |
-CounterList
{{Fill CounterList Description}}
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server Subscription Edition |
-DatabaseServer
Adds the specified performance counter to all database servers in the farm.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server Subscription Edition |
-Instance
Specifies the display name of the new performance counter.
The type must be a valid name of a performance counter instance; for example Total_PerfCounter.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server Subscription Edition |
-WebFrontEnd
Adds the specified performance counter to all Web front end computers in the farm.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server Subscription Edition |
-WhatIf
Displays a message that describes the effect of the command instead of executing the command.
For more information, type the following command: get-help about_commonparameters
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server Subscription Edition |