Cmdlet Scope

Many of the Microsoft AppFabric 1.1 for Windows Server management cmdlets require a scope to be specified to identify where in the IIS hierarchy (server, site, application, or service) the action is to be performed.

Specifying Scope

The following Windows PowerShell parameters can be used with AppFabric cmdlets to specify the scope at which the cmdlets operate:

Parameter Use

-uri <string>

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

-SiteName <string> [-VirtualPath <string>]

The SiteName parameter specifies the name of a Web site, as defined in the IIS Connections pane, which specifies that the cmdlet will operate at the scope of that site, or at the scope of an application, virtual directory, or service contained in that site. To the SiteName parameter, you can add the VirtualPath parameter that identifies an application, directory, or service included in the site. For an application or virtual directory, the virtual path includes the name of the application, as defined in IIS. 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. The VirtualPath parameter is not necessary for the site scope. The leading "/" character in the virtual path is optional. If you use the SiteName parameter, do not use the Uri parameter.

-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.

-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.

-ApplicationObject <ApplicationInfo>

The name of the ApplicationObject, which specifies that the cmdlet will operate on that application. This parameter is used to pipe the output of the Get-ASApplication cmdlet to a cmdlet containing the ApplicationObject parameter.

-ServiceInstanceObject <ServiceInstanceInfo>

The name of the ServiceInstanceObject, which specifies that the cmdlet will operate on that service.

The following are a few rules that apply to specific scopes:

  • For the service root scope, use the –root parameter flag.

  • For the site scope, use the –SiteName parameter.

  • For the application scope, use the –SiteName –VirtualPath parameter set or the –Uri parameter.

  • For the service scope, use the –SiteName –VirtualPath parameter set or the –Uri parameter.

  2012-09-12