使用 Windows Server AppFabric Cmdlet 配置工作流主机管理

本主题介绍如何使用 AppFabric Windows PowerShell cmdlet 配置与托管相关的功能。

使用 cmdlet 配置实例卸载功能

本部分介绍如何使用 AppFabric cmdlet 获取、设置或清除与指定作用域相关联的配置文件中的实例卸载功能相关的配置元素和属性。实例卸载功能允许您指定是否以及何时暂留和卸载工作流服务实例。

Cmdlet

描述

Get-ASInstanceUnloadPolicy

获取与指定作用域相关联的配置文件中 workflowIdle 元素的 timeToUnloadtimeToPersist 属性的值。

Set-ASInstanceUnloadPolicy

设置与指定作用域相关联的配置文件中 workflowIdle 元素的 timeToUnloadtimeToPersist 属性的值。如果 workflowIdle 元素不存在,则 cmdlet 将添加该元素,并设置该元素上的 timeToUnloadtimeToPersist 属性的值。如果只传递了这两个参数中的一个参数,则与另一参数对应的属性将设置为 00:00:00。

Clear-ASInstanceUnloadPolicy

从与指定作用域相关联的配置文件中删除 workflowIdle 元素。

Get-ASInstanceUnloadPolicy cmdlet 的语法选项

// to get instance unload policy settings at the root level
Get-ASInstanceUnloadPolicy -Root

// to get instance unload policy settings at the Web site level
Get-ASInstanceUnloadPolicy -SiteName <String> 

// to get instance unload policy settings at the virtual application or service level that the VirtualPath points to 
Get-ASInstanceUnloadPolicy -SiteName <String> -VirtualPath <String>] 

// to get instance unload policy settings at the site, virtual application or service level that the Uri points to
Get- ASInstanceUnloadPolicy -Uri <Uri> 

// to get instance unload policy settings at the application level specified by the ApplicationObject.
Get-ASInstanceUnloadPolicy -ApplicationObject <ApplicationInfo> 
// Ex: Get-ASApplication -SiteName "Default Web Site" -VirtualPath /SampleApp | Get-ASInstanceUnloadPolicy

// to get instance unload policy settings at the service level specified by the Service Object
Get-ASInstanceUnloadPolicy -ServiceObject <ServiceInfo> 
// Ex: Get-ASApplicationService –SiteName “Default Web Site” –VirtualPath “/SampleApp/SampleService.xamlx” | Get-ASInstanceUnloadPolicy

Set-ASInstanceUnloadPolicy cmdlet 的语法选项

Set-ASInstanceUnloadPolicy –Root –TimeToPersist <TimeSpan> -TimeToUnload <TimeSpan>

Set-ASInstanceUnloadPolicy -SiteName <String> –TimeToPersist <TimeSpan> -TimeToUnload <TimeSpan>

Set-ASInstanceUnloadPolicy -SiteName <String> -VirtualPath <string> –TimeToPersist <TimeSpan> -TimeToUnload <TimeSpan>

Set-ASInstanceUnloadPolicy –Uri <Uri> –TimeToPersist <TimeSpan> -TimeToUnload <TimeSpan>

Set-ASInstanceUnloadPolicy –ApplicationObject <ApplicationInfo> –TimeToPersist <TimeSpan> -TimeToUnload <TimeSpan>

Set-ASInstanceUnloadPolicy –ServiceObject <ServiceInfo> –TimeToPersist <TimeSpan> -TimeToUnload <TimeSpan>

特定于 Set-ASInstanceUnloadPolicy cmdlet 的参数

参数

描述

TimeToUnload

指定实例处于空闲状态之后、卸载工作流服务实例之前服务主机应等待的时间长度。

TimeToPersist

指定实例处于空闲状态之后、暂留工作流服务实例之前服务主机应等待的时间长度。

备注

只需传递要更改的参数。例如,如果要设置 timeToUnload 属性的值,则只需传递 TimeToUnload 参数。

Clear-ASInstanceUnloadPolicy cmdlet 的语法选项

Clear-ASInstanceUnloadPolicy -Root

Clear-ASInstanceUnloadPolicy -SiteName <String> 

Clear-ASInstanceUnloadPolicy -SiteName <String> -VirtualPath <String>] 

Clear- ASInstanceUnloadPolicy -Uri <Uri> 

Clear-ASInstanceUnloadPolicy -ApplicationObject <ApplicationInfo> 
// Ex: Get-ASApplication -SiteName "Default Web Site" -VirtualPath /SampleApp | Clear-ASInstanceUnloadPolicy

Clear-ASInstanceUnloadPolicy -ServiceObject <ServiceInfo> 
// Ex: Get-ASApplicationService –SiteName “Default Web Site” –VirtualPath “/SampleApp/SampleService.xamlx” | Clear-ASInstanceUnloadPolicy

使用 cmdlet 配置实例异常策略

您可以使用以下 cmdlet:

Cmdlet

描述

Get-ASInstanceExceptionPolicy

获取与指定作用域相关联的配置文件中 workflowUnhandledExceptionaction 属性的值。

Set-ASInstanceExceptionPolicy

设置与指定作用域相关联的配置文件中 workflowUnhandledExceptionaction 属性的值。如果该元素不存在,则 cmdlet 将创建该元素,然后设置该元素上的 action 属性。

Clear-ASInstanceExceptionPolicy

从与指定作用域相关联的配置文件中删除 workflowUnhandledException 元素。

Get-ASInstanceExceptionPolicy cmdlet 的语法选项

// to get instance exception policy settings at the root level
Get-ASInstanceExceptionPolicy -Root

// to get instance exception policy settings at the Web site level
Get-ASInstanceExceptionPolicy -SiteName <String> 

// to get instance exception policy settings at the virtual application or service level that the VirtualPath points to 
Get-ASInstanceExceptionPolicy -SiteName <String> -VirtualPath <String>] 

// to get instance exception policy settings at the site, virtual application or service level that the Uri points to
Get-ASInstanceExceptionPolicy -Uri <Uri> 

// to get instance exception policy settings at the application level specified by the ApplicationObject.
Get-ASInstanceExceptionPolicy -ApplicationObject <ApplicationInfo> 
// Ex: Get-ASApplication -SiteName "Default Web Site" -VirtualPath /SampleApp | Get-ASInstanceExceptionPolicy

// to get instance exception policy settings at the service level specified by the Service Object
Get-ASInstanceExceptionPolicy -ServiceObject <ServiceInfo> 
// Ex: Get-ASApplicationService –SiteName “Default Web Site” –VirtualPath “/SampleApp/SampleService.xamlx” | Get-ASInstanceExceptionPolicy

警告

如果与指定作用域相关联的配置文件中不存在相关联的 workflowUnhandledException 元素,则 IIS Manager 将 AbandonAndSuspend 显示为此字段的值。但是,如果与指定作用域相关联的配置文件中不存在 workflowUnhandledException 元素,则此 cmdlet 将不返回任何值。

Set-ASInstanceExceptionPolicy cmdlet 的语法选项

Set-ASInstanceExceptionPolicy –Root –Action {Abandon | AbandonAndSuspend | Cancel | Terminate}

Set-ASInstanceExceptionPolicy -SiteName <String> –Action {Abandon | AbandonAndSuspend | Cancel | Terminate}

Set-ASInstanceExceptionPolicy -SiteName <String> -VirtualPath <string> –Action {Abandon | AbandonAndSuspend | Cancel | Terminate}

Set-ASInstanceExceptionPolicy –Uri <Uri> –Action {Abandon | AbandonAndSuspend | Cancel | Terminate}

Set-ASInstanceExceptionPolicy –ApplicationObject <ApplicationInfo> –Action {Abandon | AbandonAndSuspend | Cancel | Terminate}

Set-ASInstanceExceptionPolicy –ServiceObject <ServiceInfo> –Action {Abandon | AbandonAndSuspend | Cancel | Terminate}

特定于 Set-ASInstanceExceptionPolicy cmdlet 的参数

参数

描述

操作

指定工作流服务实例运行时遇到无法处理的异常时服务主机应执行的操作。

  • Abandon。服务主机中止内存中的工作流服务实例。数据库中该实例的状态保持“Active”。Workflow Management service 将从暂留数据库中保存的最近暂留点恢复已放弃的工作流服务实例。

  • Abandon 和 suspend。服务主机中止内存中的工作流服务实例,并且将暂留数据库中该实例的状态设置为“已挂起”。以后使用 IIS Manager 可以恢复或终止已挂起的工作流服务实例。Workflow Management service 不会自动恢复这些工作流服务实例。

  • Terminate。服务主机中止内存中的工作流服务实例,并且将暂留数据库中该实例的状态设置为“已完成(已终止)”。以后无法恢复已终止的工作流服务实例。

  • Cancel。服务主机取消引起要调用的所有取消处理程序的工作流服务实例以便工作流顺利终止,并且将暂留数据库中该实例的状态设置为“已完成(已取消)”。

Clear-ASInstanceExceptionPolicy cmdlet 的语法选项

Clear-ASInstanceExceptionPolicy -Root

Clear-ASInstanceExceptionPolicy -SiteName <String> 

Clear-ASInstanceExceptionPolicy -SiteName <String> -VirtualPath <String>] 

Clear-ASInstanceExceptionPolicy -Uri <Uri> 

Clear-ASInstanceExceptionPolicy -ApplicationObject <ApplicationInfo> 

Clear-ASInstanceExceptionPolicy -ServiceObject <ServiceInfo> 

使用 cmdlet 配置实例管理策略

您可以使用以下 cmdlet:

Cmdlet

描述

Get-ASInstanceManagement

获取与指定作用域相关联的配置文件中 workflowInstanceManagementauthorizedWindowsGroup 属性的值。

Set-ASInstanceManagement

设置与指定作用域相关联的配置文件中 workflowInstanceManagementauthorizedWindowsGroup 属性的值。如果该元素不存在,则 cmdlet 将创建该元素,然后设置该元素上的 action 属性。

Clear-ASInstanceManagement

从与指定作用域相关联的配置文件中删除 workflowInstanceManagement 元素。cmdlet 还向配置文件添加 <remove name="workflowInstanceManagement" />

Get-ASInstanceManagement cmdlet 的语法选项

// to get instance management policy settings at the root level
Get-ASInstanceManagement -Root

// to get instance management policy settings at the Web site level
Get-ASInstanceManagement -SiteName <String> 

// to get instance management policy settings at the virtual application or service level that the VirtualPath points to 
Get-ASInstanceManagement -SiteName <String> -VirtualPath <String>] 

// to get instance management policy settings at the site, virtual application or service level that the Uri points to
Get-ASInstanceManagement -Uri <Uri> 

// to get instance management policy settings at the application level specified by the ApplicationObject.
Get-ASInstanceManagement -ApplicationObject <ApplicationInfo> 
// Ex: Get-ASApplication -SiteName "Default Web Site" -VirtualPath /SampleApp | Get-ASInstanceManagement

// to get instance management policy settings at the service level specified by the Service Object
Get-ASInstanceManagement -ServiceObject <ServiceInfo> 
// Ex: Get-ASApplicationService –SiteName “Default Web Site” –VirtualPath “/SampleApp/SampleService.xamlx” | Get-ASInstanceManagement

Set-ASInstanceManagement cmdlet 的语法选项

Set-ASInstanceManagement –Root –AuthorizedWindowsGroup <String>}

Set-ASInstanceManagement -SiteName <String> –AuthorizedWindowsGroup <String>}

Set-ASInstanceManagement -SiteName <String> -Virtual Path <String> –AuthorizedWindowsGroup <String>}
Set-ASInstanceManagement -SiteName <String> -Virtual Path <String> –Root –EnableNetPipeProtocol
Set-ASInstanceManagement -SiteName <String> -Virtual Path <String> –AuthorizedWindowsGroup <String>} –Root –EnableNetPipeProtocol

Set-ASInstanceManagement –Uri <Uri> –AuthorizedWindowsGroup <String>}

Set-ASInstanceManagement –ApplicationObject <ApplicationInfo> –AuthorizedWindowsGroup <String>}

Set-ASInstanceManagement –ServiceObject <ServiceInfo> –AuthorizedWindowsGroup <String>}

Clear-ASInstanceManagement cmdlet 的语法选项

Clear-ASInstanceManagement -Root

Clear-ASInstanceManagement -SiteName <String> 

Clear-ASInstanceManagement -SiteName <String> -VirtualPath <String>] 

Clear-ASInstanceManagement -Uri <Uri> 

Clear-ASInstanceManagement -ApplicationObject <ApplicationInfo> 

Clear-ASInstanceManagement -ServiceObject <ServiceInfo> 

  2011-12-05