Getting the Next Available Cluster Entry ID
Getting the Next Available Cluster Entry ID
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 gets the next cluster ID. This example uses a function for Getting the Next Available Entry ID for a Server.
Visual Basic
'////////////////////////////////////////////////////////////////////// ' Function: getNextClusterEntryID() ' Purpose: Get's the entry ID for the virtual server with the name passed in. ' ' Input: szServers: Semi-colon list of cluster servers ' szDomain: Domain name ' szOrganization: Organization name ' szAdminGroup: Administrative group ' szAdminUserName: Administrator user name ' szAdminPassword: Administrator password ' szDirectoyServer: Name of the Directory Server ' ' Output: getNextClusterEntryID: Contains Error code (if any) ' szEntryid ID of server ' ' 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. '////////////////////////////////////////////////////////////////////// Public Function getNextClusterEntryID(ByVal szServers As String, _ ByRef szEntryID As String, _ ByVal szDomain, _ ByVal szOrganization, _ ByVal szAdminGroup, _ ByVal szAdminUserName, _ ByVal szAdminPassword, ByVal szDirectoryServer) As Integer Dim szaServerList() As String Dim iEntryIDNum As Integer Dim iTempEntryID As String Dim iIndex As Integer On Error GoTo errhandler iEntryIDNum = 0 szaServerList = Split(szServers, ";", -1, 1) For iIndex = LBound(szaServerList) To UBound(szaServerList) getNextAvailableEntryID szDomain, _ szOrganization, _ szAdminGroup, _ szaServerList(iIndex), _ szAdminUserName, _ szAdminPassword, _ iTempEntryID, _ szDirectoryServer If iEntryIDNum <= Int(Val(iTempEntryID)) Then iEntryIDNum = Int(Val(iTempEntryID)) End If Next getNextClusterEntryID = 0 szEntryID = Trim(Str(iEntryIDNum)) Exit Function ' Error handling. errhandler: getNextClusterEntryID = 1 ' Implement error logging here. End Function
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.