使用 AppFabric Cmdlet 來設定工作流程主機管理
此主題說明如何使用 AppFabric Windows PowerShell Cmdlet 來設定與主控相關的功能。
使用 Cmdlet 來設定執行個體解除載入功能
本節說明如何使用 AppFabric Cmdlet,在與指定範圍關聯的組態檔中,取得、設定或清除與執行個體解除載入功能相關的組態元素與屬性。執行個體解除載入功能可讓您指定是否要以及何時要解除載入工作流程服務執行個體,並放入持續性資料庫。
Cmdlet |
描述 |
Get-ASInstanceUnloadPolicy |
在與指定範圍關聯的組態檔中,取得 workflowIdle 元素的 timeToUnload 與 timeToPersist 屬性值。 |
Set-ASInstanceUnloadPolicy |
在與指定範圍關聯的組態檔中,設定 workflowIdle 元素的 timeToUnload 與 timeToPersist 屬性值。若 workflowIdle 元素不存在,則此 Cmdlet 會新增該元素,然後設定該元素的 timeToUnload 與 timeToPersist 屬性值。若您只傳遞兩個參數的其中一個,則對應到另一個參數的屬性會被設定為 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 |
從與指定範圍關聯的組態檔取得 workflowUnhandledException 的 action 屬性值。 |
Set-ASInstanceExceptionPolicy |
在與指定範圍關聯的組態檔中設定 workflowUnhandledException 的 action 屬性值。若該元素不存在,則此 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 管理員」會將此欄位的值顯示為 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 的特定參數
參數 |
描述 |
動作 |
指定當服務主機執行的工作流程服務執行個體發生未處理的例外狀況時,服務主機應該執行的動作。
|
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 |
從與指定範圍關聯的組態檔取得 workflowInstanceManagement 元素的 authorizedWindowsGroup 屬性值。 |
Set-ASInstanceManagement |
在與指定範圍關聯的組態檔中設定 workflowInstanceManagement 元素的 authorizedWindowsGroup 屬性值。若該元素不存在,則此 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>
2012-03-05