Вы можете использовать WMI для поиска информации. Это должно работать с XP / Win32 и т. Д.
Здесь есть отличная информация об использовании VBScript для выполнения этой работы:
http://www.activexperts.com/activmonitor/windowsmanagement/scripts/networking/clustering/
Вот код C # / .Net, который также использует WMI:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
using System.Management;
namespace SandboxConsole
{
public class ClusterAdmin
{
[MTAThread]
public static void Main()
{
string clusterName = "MyCluster"; // cluster alias
string custerGroupResource = "FS_Resource1"; // Cluster group name
ConnectionOptions options = new ConnectionOptions();
options.Username = "ClusterAdmin"; //could be in domain\user format
options.Password = "HisPassword";
// Connect with the mscluster WMI namespace on the cluster named "MyCluster"
ManagementScope s = new ManagementScope("\\\\" + clusterName + "\\root\\mscluster", options);
ManagementPath p = new ManagementPath("Mscluster_Clustergroup.Name='" + custerGroupResource + "'");
using (ManagementObject clrg = new ManagementObject(s, p, null))
{
// Take clustergroup off line and read its status property when done
TakeOffLine(clrg);
clrg.Get();
Console.WriteLine(clrg["Status"]);
System.Threading.Thread.Sleep(3000); // Sleep for a while
// Bring back online and get status.
BringOnLine(clrg);
clrg.Get();
Console.WriteLine(clrg["Status"]);
}
}
static void TakeOffLine(ManagementObject resourceGroup)
{
ManagementBaseObject outParams =
resourceGroup.InvokeMethod("Takeoffline", null, null);
}
static void BringOnLine(ManagementObject resourceGroup)
{
ManagementBaseObject outParams =
resourceGroup.InvokeMethod("Takeoffline", null, null);
}
}
}
Я нашел этот код здесь и немного прибрался.