Set-ASAppPerformanceCounter

Set-ASAppPerformanceCounter

Enables all services in one or more applications to emit performance counter data. This cmdlet adds the performanceCounters attribute to the /configuration/system.serviceModel/diagnostics element. Based on the level parameter, you can enable performance counter data from all category counters (ServiceModelService, ServiceModelEndpoint, and ServiceModelOperation) or from only ServiceModelService category counters.

Syntax

Parameter Set: SiteNameAndVirtualPath
Set-ASAppPerformanceCounter [-SiteName] <String> [[-VirtualPath] <String> ] -Level <PerformanceCounterScope> [-Confirm] [-WhatIf] [ <CommonParameters>]


Parameters

-ApplicationObject<ApplicationInfo>

The name of the ApplicationObject, which specifies that the cmdlet will operate on that application.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

-Level<PerformanceCounterScope>

The scope of the performance counter. Can be either All, so that all category counters (ServiceModelService, ServiceModelEndpoint and ServiceModelOperation) are enabled; Default, so that ServiceModel performance counters are disabled; Off, so that ServiceModel performance counters are disabled (the default value); or ServiceOnly, so that only ServiceModelService category counters are enabled.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

-Root

The name of the root application, which specifies that the cmdlet will operate at that scope. If you use the Root parameter, do not use the SiteName, VirtualPath, or Uri parameter.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

-SiteName<String>

The name of a Web site, as defined in the IIS Connections pane, which specifies that the cmdlet will operate at the scope of an application or virtual directory contained within that site. To the SiteName parameter, you must add the VirtualPath parameter that identifies an application or virtual directory contained within the site. The virtual path must include the name of the application or virtual directory as defined in IIS. The leading "/" character in the virtual path is optional. If you use the SiteName parameter, do not use the Uri parameter.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

-Uri<Uri>

A URI for an IIS application or virtual directory, which specifies that the cmdlet will operate at that scope. If you use the Uri parameter, do not use the SiteName and VirtualPath parameter set.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

-VirtualPath<String>

The virtual path for an application or directory, as defined in the IIS Manager Connections pane, which specifies that the cmdlet will operate at the scope of that application or virtual directory. You must add the VirtualPath parameter to the SiteName parameter, using SiteName to identify the site that the application or directory is included in. The leading "/" character in the virtual path is optional. The virtual path includes the name of the application or directory, as defined in IIS. If you use the SiteName and VirtualName parameter set, do not use the Uri parameter.


Aliases

none

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

-Confirm

Prompts you for confirmation before executing the command.


Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Describes what would happen if you executed the command without actually executing the command.


Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • None.


Outputs

The output type is the type of the objects that the cmdlet emits.

  • None.


Examples

EXAMPLE 1

Enables all services in the myApp application of the Default Web Site to emit performance counter data from all category counters (ServiceModelService, ServiceModelEndpoint and ServiceModelOperation).


Set-ASAppPerformanceCounter -SiteName “Default Web Site” -VirtualPath “/myApp” -Level “All”

EXAMPLE 2

Disables the emitting of performance counter data from all services in the myApp application of the Default Web Site.


Set-ASAppPerformanceCounter -SiteName “Default Web Site” -VirtualPath “/myApp” -Level “Off”
Show: