Export (0) Print
Expand All
Expand Minimize

Set-ASAppServiceBehaviorName

Set-ASAppServiceBehaviorName

Sets the name of the behavior configuration element (in the application’s web.config file) that the service uses. If the name of the behavior configuration element is set to a string (a named behavior), this cmdlet disables the use of default configuration settings. If the name of the behavior configuration element is set to an empty string (a nameless behavior), this cmdlet enables the use of default configuration settings. If you enable default settings, default configuration settings merged from all levels of scope will be used for the service, rather than the service’s own configuration settings. The Set-ASAppServiceBehaviorName cmdlet is executed when you select the Use defaults checkbox in the General Tab of the Configure Service dialog box in the IIS Manager, and then click OK.

Syntax

Parameter Set: SiteNameAndVirtualPath
Set-ASAppServiceBehaviorName [-SiteName] <String> [-VirtualPath] <String> -BehaviorName <String> [ <CommonParameters>]


Parameters

-BehaviorName<String>

If you set the value of <String> associated with the BehaviorName parameter to an empty string (“”), this will set the service behavior in the Web.config file to a nameless behavior that will ensure that the services will inherit default configuration settings merged from the application, site, or server level.

If you set the value of <String> associated with the BehaviorName parameter to a string, this cmdlet disables the use of default configuration settings and sets the name of the behavior configuration element (in the application’s web.config file) to that string. That named behavior must have values that the service can access or the service will not be activated.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

-ServiceObject<ServiceInfo>

The name of the ServiceObject, which specifies that the cmdlet will operate on that service. This parameter is typically used to pipe the output of the Get-ASAppService cmdlet to a cmdlet containing the ServiceObject parameter.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

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 a service contained within that site. To the SiteName parameter, you must add the VirtualPath parameter that identifies a service contained within the site. The virtual path must include the name of the application, a forward slash, and the name of the .svc file or .xamlx file for the service. 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 a service, 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 a service, as defined in the IIS Manager Connections pane, which specifies that the cmdlet will operate at the scope of the service. You must add the VirtualPath parameter to the SiteName parameter, using SiteName to identify the site that the service is included in. The leading "/" character in the virtual path is optional. For a service, the virtual path includes the name of the application, a forward slash, and the name of the .svc file or .xamlx file for the service. If you use the SiteName and VirtualName parameter set, do not use the Uri parameter.


Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

<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

Sets the behavior for a service to a named behavior. Specifies that the svc1 service in the myApp application of the Default Web Site will use the configuration settings in the behaviorConfiguration named “Svc1” in the configuration file for the myApp application.


Set-ASAppServiceBehaviorName -SiteName “Default Web Site” -VirtualPath “/myApp/svc1.xamlx” -BehaviorName “Svc1”

EXAMPLE 2

Sets the behavior for a service to the default behavior. This specifies that the svc1 service in the myApp application of the Default Web Site will use the default configuration settings. These settings will be inherited from the lowest scope whose configuration has a nameless behavior defined in it.


Set-ASAppServiceBehaviorName -SiteName “Default Web Site” -VirtualPath “/myApp/svc1.xamlx” -BehaviorName “”

EXAMPLE 3

Sets the behavior used for all services in an application to the default behavior. This code pipes the output of Get-ASApplication (ApplicationInfo) to Get-ASApplicationService. That cmdlet in turn returns data about all services in the application as its output (ServiceInfo), which is piped to Set-ASAppServiceBehaviorName. The ServiceInfo object includes the SiteName and VirtualPath properties for each service in the application, enabling Set-ASAppServiceBehaviorName to operate on all services in the application without the need to specify the SiteName and VirtualPath parameters for each service in separate calls to Set-ASAppServiceBehaviorName.


Get-ASApplication –SiteName “Default Web Site” –VirtualPath “/myApp” | Get-ASApplicationService | Set-ASAppServiceBehaviorName –BehaviorName “”
Show:
© 2015 Microsoft