提供服务的实例,并提供启动和停止功能。
语法
class MSBTS_ServiceInstance : MSBTS_BTSObject
成员
MSBTS_ServiceInstance 定义以下属性:
| 资产 | DESCRIPTION |
|---|---|
| ActivationTime | 包含服务实例的激活时间。 |
| AssemblyCulture | 包含对应于此消息所属的服务实例的 .NET 程序集的区域性。 |
| AssemblyName | 包含与消息实例关联的程序集的名称。 |
| AssemblyPublicKeyToken | 包含与此消息所属的服务实例对应的 .NET 程序集的公钥令牌。 |
| AssemblyVersion | 包含与此消息所属的服务实例相对应的 .NET 程序集的版本。 |
Caption (继承自 CIM_ManagedSystemElement) |
有关该CIM_ManagedSystemElement类的详细信息,请参阅 Windows Management Instrumentation 文档。https://go.microsoft.com/fwlink/?LinkID=20245 |
说明 (继承自 CIM_ManagedSystemElement) |
有关该CIM_ManagedSystemElement类的详细信息,请参阅 Windows Management Instrumentation 文档。https://go.microsoft.com/fwlink/?LinkID=20245 |
| ErrorCategory | 包含服务实例挂起时的错误类别。 |
| ErrorDescription | 包含服务实例挂起时的错误说明。 |
| ErrorID | 包含暂停服务实例时的错误代码。 |
| HostName | 包含与此队列对应的主机的名称。 |
InstallDate (继承自 CIM_ManagedSystemElement) |
有关该CIM_ManagedSystemElement类的详细信息,请参阅 Windows Management Instrumentation 文档。https://go.microsoft.com/fwlink/?LinkID=20245 |
| InstanceID | 包含此消息所属的服务实例的 ID。 |
| MgmtDbNameOverride | 重写 BizTalk 管理数据库连接字符串的初始目录部分,并表示数据库名称。 此属性未针对 BizTalk Server 实现,并保留供将来使用。 |
| MgmtDbServerOverride | 重写 BizTalk 管理数据库连接字符串的数据源部分。 此属性未针对 BizTalk Server 实现,并保留供将来使用。 |
| MsgBoxDBName | 包含 MessageBox 数据库的名称。 |
| MsgBoxDBServerName | 包含 MessageBox 数据库所在的 SQL Server 的名称。 |
名称(继承自 CIM_ManagedSystemElement) |
有关该CIM_ManagedSystemElement类的详细信息,请参阅 Windows Management Instrumentation 文档。https://go.microsoft.com/fwlink/?LinkID=20245 |
| PendingOperation | 包含此服务实例的挂起作的类型(如果有)。 |
| PendingOperationTime | 包含上次挂起作的时间。 |
| ServiceClass | 包含与消息实例相对应的服务类的名称。 |
| ServiceClassID | 包含消息实例所属的服务类的 ID。 |
| ServiceName | 包含与消息实例相对应的服务的名称。 |
| OrchestrationStatus | 包含此消息所属的服务实例的状态。 |
| ServiceTypeID | 包含消息实例所属的服务类型的 ID。 |
状态(继承自 CIM_ManagedSystemElement) |
有关该CIM_ManagedSystemElement类的详细信息,请参阅 Windows Management Instrumentation 文档。https://go.microsoft.com/fwlink/?LinkID=20245 |
| SuspendTime | 包含服务实例暂停的时间。 |
MSBTS_ServiceInstance 定义以下方法:
| 方法 | DESCRIPTION |
|---|---|
| 简历 | 使管理员能够恢复服务的实例。 |
| 暂停 | 使管理员能够挂起服务的实例。 |
| 终止 | 使管理员能够终止服务的实例。 |
示例:
以下示例显示如何限制对 MSBTS_ServiceInstance 和 MSBTS_MessageInstance WMI 类的 WMI 查询结果。 这两个 WMI 类支持允许限制结果集的 WMI 上下文属性。 这是必需的,因为服务实例或消息实例的数量可能非常大。 对于任何其他 BizTalk WMI 类来说,情况并非如此,WMI 上下文不应与它们一起使用。
EnumAllInstances
If Err <> 0 Then
PrintWMIErrorThenExit Err.Description, Err.Number
End If
Sub EnumAllInstances
Dim Context, FromTime, UntilTime, InstSet, Query
wbemFlagReturnImmediately = 16 '0x10
Set Context = CreateObject("WbemScripting.SWbemNamedValueSet")
Set FromTime = CreateObject("WbemScripting.SWbemDateTime")
Set UntilTime = CreateObject("WbemScripting.SWbemDateTime")
FromTime.Year = 2003
UntilTime.Year = 2003
UntilTime.Month = 3
UntilTime.Day = 26
UntilTime.Hours = 19
UntilTime.Minutes = 32
Context.Add "From", FromTime.Value
Context.Add "Until", UntilTime.Value
Context.Add "IterationDelayMS", 10
Query = "SELECT * FROM MSBTS_ServiceInstance"
Set InstSet = GetObject("Winmgmts:!root\MicrosoftBizTalkServer").ExecQuery(Query, "WQL", wbemFlagReturnImmediately, Context)
If Err <> 0 Then
PrintWMIErrorThenExit Err.Description, Err.Number
End If
For Each Inst In InstSet
wscript.echo Inst.InstanceID + " " + Inst.HostName
Next
End Sub
Sub PrintWMIErrorThenExit(strErrDesc, ErrNum)
On Error Resume Next
Dim objWMIError : Set objWMIError = CreateObject("WbemScripting.SwbemLastError")
If ( TypeName(objWMIError) = "Empty" ) Then
wscript.echo strErrDesc & " (HRESULT: " & Hex(ErrNum) & ")."
Else
wscript.echo objWMIError.Description & "(HRESULT: " & Hex(ErrNum) & ")."
Set objWMIError = nothing
End If
End Sub
未提供 C# 示例。
注解
此类可能有许多实例,并且枚举所有这些类可能很慢,并且不必要地使用 MessageBox 数据库中的资源。 如果服务实例的 ID 是已知的,请使用它在任何数据库查找中指定消息实例。 例如,select * from MSBTS_ServiceInstance where ServiceInstanceID= "GUID"。 WMI 将分析 WQL 以从查询中检索服务 ID,并仅检索与指定 ID 匹配的实例。
要求
标头:在 BTSWMISchema2K.mof 或 BTSWMISchemaXP.mof 中声明。
命名空间:包含在 \root\MicrosoftBizTalkServer 中。