我想检查特定的Hyper-V节点是否属于任何群集。
我只是有Hyper-V机器的名称,说HyperV01
,我想检查这台机器是否属于任何群集。
我还将在网络上的任何计算机上执行此脚本。
有人知道怎么做这个吗?
最佳答案
如果主机是任何群集的一部分,则将返回true;否则,将返回false(https://gallery.technet.microsoft.com/scriptcenter/da51bcca-8407-45c3-896a-0df98014a4d5):
if((Get-WMIObject -Class MSCluster_ResourceGroup -ComputerName $Servername -Namespace root\mscluster) -ne $null){return $true}else {return $false}
关于powershell - Hyper-V:检查主机是否属于任何群集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33436832/