Share via


Getting the Property Value of a Cluster Resource

Getting the Property Value of a Cluster Resource

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The following example returns the specified property value on a specified resource.

Visual Basic

'//////////////////////////////////////////////////////////////////////
' Function: getPropertyValue()
' Purpose:  Returns the specified property value on a specified resource.
'
' Input:    oGroup:                   Cluster group
'           szResourceName:           Name of resource property exists on
'           szPropName:               Name of property on resource
'
' Output:   getPropertyValue:         Contains Error code (if any)
'           szPropValue:              Property value
'
' Note:  In order for this example to function correctly, it may be necessary to include
' references to the following libraries: Active DS Type Library, Microsoft CDO for
' Exchange Management Library, Microsoft Cluster Service Automation Classes,
' Microsoft CDO for Windows 2000 Library.
'//////////////////////////////////////////////////////////////////////
Private Sub getPropertyValue(ByVal oGroup As msclusterlib.ClusResGroup, _
                             ByVal szResourceName As String, _
                             ByVal szPropName As String, _
                             ByRef szPropValue As String)

    Dim iResourceCount As Integer
    Dim iPropertyCount As Integer

    For iResourceCount = 1 To oGroup.Resources.Count
        If oGroup.Resources(iResourceCount).TypeName = szResourceName Then
            For iPropertyCount = 1 To oGroup.Resources(iResourceCount).PrivateProperties.Count
                If oGroup.Resources(iResourceCount).PrivateProperties(iPropertyCount).Name = szPropName Then
                    szPropValue = oGroup.Resources(iResourceCount).PrivateProperties(iPropertyCount).value
                    Exit For
                End If
            Next
        Exit For
        End If
    Next

End Sub

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.