Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Cluster scripting question

Status
Not open for further replies.

cbodnar

MIS
May 27, 2003
4
US
I’m trying to pull all the Cluster Names in the domain using a VBScript. I have seen this reference to the Cluster Automation Server on MSDN:



It looks like I should be able to do this with something similar to this (which of course doesn’t work). I am running this on the Cluster server:


~~~~~~

Set objCluster = CreateObject("MSCluster.ClusApplication")

set objClust2 = objCluster.ClusterNames("acme.local")

For Each objClust In objClust2


WScript.Echo objClust.Item

Next

I have this script that works to pull the active node from a group so I think I’m on the right track:



Set objCluster = CreateObject("MSCluster.Cluster")

objCluster.Open("sql1t")

WScript.Echo objCluster.ResourceGroups.Item("Cluster Group").OwnerNode.Name

Set objCluster = Nothing







TIA
 
Figured it out:

On Error Resume Next
Set objCluster = CreateObject("MSCluster.ClusApplication")

'This must be the NetBIOS name for domain
'FQDN will not work
Set objClust2 = objCluster.ClusterNames("abc")

'WScript.echo objclust2.count

For i = 1 To objclust2.count
strClustName = objClust2.Item(i)
Set objClusterCon = CreateObject("MSCluster.Cluster")
objClusterCon.Open(strClustName)
WScript.Echo "Cluster Name = " & strClustName
'WScript.Echo objClusterCon.ResourceGroups.count

For Each objResGroupName In objClusterCon.ResourceGroups

strResGroupName = objResGroupName.Name
'WScript.Echo strResGroupName
WScript.Echo "Active Node for the " & strResGroupName & " Resource Group = " & objClusterCon.ResourceGroups.Item(strResGroupName).OwnerNode.Name

Next


'WScript.Echo "Cluster Name = " & strClustName
WScript.Echo vbcrlf
Set objCluster = Nothing

Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top