Python 如何在Windows Server 2008 R2上使用WMI获取群集id?

Python 如何在Windows Server 2008 R2上使用WMI获取群集id?,python,wmi,windows-server-2008-r2,failovercluster,Python,Wmi,Windows Server 2008 R2,Failovercluster,在powershell命令中,可以使用Get cluster | select ID检索集群ID属性 如何使用WMI获取它?看起来MSCluster\u群集没有ID字段。可以自己找到群集ID。以防万一,如果有人找同样的 在注册表中找到群集id。 HKEY\U LOCAL\U MACHINE\Cluster 键:ClusterInstanceId您也可以使用ROOT\MSCluster:MSCluster\u ClusterService.ElementName通过WMI获得此项

在powershell命令中,可以使用
Get cluster | select ID
检索集群ID属性


如何使用WMI获取它?看起来MSCluster\u群集没有ID字段。

可以自己找到群集ID。以防万一,如果有人找同样的

在注册表中找到群集id。
HKEY\U LOCAL\U MACHINE\Cluster


键:
ClusterInstanceId

您也可以使用ROOT\MSCluster:MSCluster\u ClusterService.ElementName通过WMI获得此项