Microsoft BizTalk Server 2004
MSBTS_ServiceInstance (WMI)

Provides an instance of a service, with start and stop functionality.

Declaration

class MSBTS_ServiceInstance : MSBTS_BTSObject

Members

MSBTS_ServiceInstance defines the following properties:

PropertyDescription
ActivationTimeContains the activation time for a service instance.
AssemblyCultureContains the culture of the .NET assembly that corresponds to the service instance to which this message belongs.
AssemblyNameContains the name of the assembly associated with the message instance.
AssemblyPublicKeyTokenContains the public key token of the .NET assembly that corresponds to the service instance to which this message belongs.
AssemblyVersionContains the version of the .NET assembly that corresponds to the service instance to which this message belongs.
Caption (Inherited from CIM_ManagedSystemElement)For more information about the CIM_ManagedSystemElement class, see the Windows Management Instrumentation documentation at http://go.microsoft.com/fwlink/?LinkID=20245.
Description (Inherited from CIM_ManagedSystemElement)For more information about the CIM_ManagedSystemElement class, see the Windows Management Instrumentation documentation at http://go.microsoft.com/fwlink/?LinkID=20245.
ErrorCategoryContains the error category when service instance is suspended.
ErrorDescriptionContains the error description when service instance is suspended.
ErrorIDContains the error code when service instance is suspended.
HostNameContains the name of the host that corresponds to this queue.
InstallDate (Inherited from CIM_ManagedSystemElement)For more information about the CIM_ManagedSystemElement class, see the Windows Management Instrumentation documentation at http://go.microsoft.com/fwlink/?LinkID=20245.
InstanceIDContains the ID of the service instance to which this message belongs.
MgmtDbNameOverrideOverrides the initial catalog part of the Configuration database connect string, and represents the database name. This property was not implemented for BizTalk Server 2004 and is reserved for future use.
MgmtDbServerOverrideOverrides the data source part of the Configuration database connect string. This property was not implemented for BizTalk Server 2004 and is reserved for future use.
MsgBoxDBNameContains the name of the MessageBox database.
MsgBoxDBServerNameContains the name of the SQL Server where the MessageBox database is located.
Name (Inherited from CIM_ManagedSystemElement)For more information about the CIM_ManagedSystemElement class, see the Windows Management Instrumentation documentation at http://go.microsoft.com/fwlink/?LinkID=20245.
PendingOperationContains the type of a pending operations (if any) for this service instance.
PendingOperationTimeContains the time of last pending operation.
ServiceClassContains the name of the service class that corresponds to the message instance.
ServiceClassIDContains the ID of the service class to which the message instance belongs.
ServiceInstanceIDContains the ID of the service instance to which the message instance belongs.
ServiceNameContains the name of the service that corresponds to the message instance.
ServiceStatusContains the state of the service instance to which this message belongs.
ServiceTypeIDContains the ID of the service type to which the message instance belongs.
Status (Inherited from CIM_ManagedSystemElement)For more information about the CIM_ManagedSystemElement class, see the Windows Management Instrumentation documentation at http://go.microsoft.com/fwlink/?LinkID=20245.
SuspendTimeContains the time at which the service instance was suspended.

MSBTS_ServiceInstance defines the following properties:

PropertyDescription
ResumeEnables an administrator to resume an instance of a service.
SuspendEnables an administrator to suspend an instance of a service.
TerminateEnables an administrator to terminate an instance of a service.

Example

[Visual Basic]

The following example displays how to limit the results of WMI queries on the MSBTS_ServiceInstance and MSBTS_MessageInstance WMI classes. These two WMI classes have support for WMI context properties that allow limiting a result set. This is required because the number of service instances or message instances may be very large. This is not the case for any other BizTalk WMI class and WMI context should be not used with them.

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#] No C# sample is provided.

Remarks

This class may have many instances, and enumerating all of these classes may be slow and unnecessarily consume resources from the MessageBox database. If the ID of the service instance is known, use it to specify the message instance in any database lookups. For example, select * from MSBTS_ServiceInstance where ServiceInstanceID= "GUID". WMI will parse the WQL to retrieve the service ID from the query and only retrieve instances that match the specified IDs.

Requirements

Header: Declared in BTSWMISchema2K.mof or BTSWMISchemaXP.mof.

Namespace: Included in \root\MicrosoftBizTalkServer.

To download updated BizTalk Server 2004 Help from www.microsoft.com, go to http://go.microsoft.com/fwlink/?linkid=20616.

Copyright © 2004 Microsoft Corporation.
All rights reserved.
Page view tracker