次の方法で共有


ClusVersion object

[The ClusVersion object is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions.]

Provides version information about the operating system and the Cluster service. For more information on cluster versions and version numbers, see Version Compatibility.

Members

The ClusVersion object has these types of members:

Properties

The ClusVersion object has these properties.

Property Description
BuildNumber
Returns the build number of the operating system installed on the local node.
ClusterHighestVersion
Returns the current value of ClusterHighestVersion.
ClusterLowestVersion
Returns the current value of ClusterLowestVersion
CSDVersion
Returns the number of the latest Service Pack installed on the local node.
Flags
Returns any cluster version flags set in the cluster.
MajorVersion
Returns the major version number of the operating system installed on the local node.
MinorVersion
Returns the major version number of the operating system installed on the local node.
MixedVersion
Indicates whether different versions of the Cluster service are present in the cluster.
Name
Returns the name of the cluster.
VendorId
Returns vendor identification information for the version of Cluster service installed on the local node.

Remarks

A ClusVersion collection:

Some of the ClusVersion properties correspond to dynamic values maintained internally by the cluster. A ClusVersion object is instantiated with a snapshot of those values and stores them statically. Therefore, the ClusVersion property values represent the state of the cluster when the object was first created. To obtain the latest version information from the cluster, create a new ClusVersion object.

For more information about the versioning process see Version Compatibility.

Examples

The following script instantiates and uses a ClusVersion object.

'---------------------------------------------------------------------
' ClusVersion.vbs
' Uses the ClusVersion object to display version information about
' the local cluster.
'---------------------------------------------------------------------
Option Explicit
Const LOW16 = 65535
Dim objClus, objVers
Dim strVersion, strOSVersion, strHighest, strLowest

' Connect to the local cluster and get a ClusVersion object.
Set objClus = CreateObject("MSCluster.Cluster")
objClus.Open ""
Set objVers = objClus.Version

' Format a string describing the current version
strOSVersion = CStr(objVers.MajorVersion) & "." & _
               CStr(objVers.MinorVersion) & "." & _
               CStr(objVers.BuildNumber)

' Format a string describing the highest compatible version.
' We must extract the upper and lower 16 bits of the 32-bit value.
strHighest = CStr(CLng(objVers.ClusterHighestVersion / (2 ^ 15))) & _
             ".0." & _
             CStr(CLng(objVers.ClusterHighestVersion And LOW16))

' Format a string describing the lowest compatible version.
' We must extract the upper and lower 16 bits of the 32-bit value.
strLowest = CStr(CLng(objVers.ClusterLowestVersion / (2 ^ 15))) & _
            ".0." & _
            CStr(CLng(objVers.ClusterLowestVersion And LOW16))

' Format and display the output string.
strVersion = objVers.Name & vbCrLf & _
             objVers.VendorID & " version " & _
             strOSVersion & vbCrLf & "Compatible with versions: " & _
             strLowest & " and " & strHighest & vbCrLf
WScript.Echo strVersion

Set objVers = Nothing
Set objClus = Nothing

Requirements

Minimum supported client
None supported
Minimum supported server
Windows Server 2008 Enterprise, Windows Server 2008 Datacenter
Header
MsClus.h
IDL
MsClus.idl
Type library
MsClus.tlb
DLL
MsClus.dll
IID
IID_ISClusVersion is defined as F2E60716-2631-11D1-89F1-00A0C90D061E

See also

Cluster Management Objects