Get all the servers in a cluster
Function GetClusterServers(server As String, getAllServers As Boolean) As Variant
Dim s as New NotesSession
Dim cluster As String
Dim serverDoc As NotesDocument
Dim serverName As NotesName
Dim key(1 To 2) As Variant
Dim navdoc As NotesViewEntry
Dim nav As NotesViewNavigator ‘ define domain and name as per the default "Servers" view
Set serverName = New NotesName(server)
key(1) = serverName.Organization
key(2) = serverName.Abbreviated
Set serverDoc = GetDocFromDb(s.CurrentDatabase, "Servers", key, True) ‘ get a list of servers in the same cluster
cluster = serverDoc.ClusterName(0)
Set nav = GetCategoryDocsFromDb(currentDb, "Clusters", cluster) ‘ go through the category, add names to replica list
Set navdoc = nav.GetFirstDocument()
While Not navdoc Is Nothing
Set serverDoc = navdoc.Document
If serverDoc.ServerName(0) <> server Or getAllServers Then
Set serverName = New NotesName(serverDoc.ServerName(0))
GetClusterServers = GetClusterServers & serverName.Abbreviated & ","
End If
Set navdoc = nav.GetNextDocument(navdoc)
Wend ‘ tighten up the list
GetClusterServers = Split(GetClusterServers, ",")
GetClusterServers = Fulltrim(GetClusterServers)
End Function
Original source : http://www.openntf.org/projects/codebin/codebin.ns…