powershell - Hyper-V:检查主机是否属于任何群集

标签 powershell virtualization hyper-v powershell-remoting

我想检查特定的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/

相关文章:

cloud - 为什么centos6.0去掉了对xen的支持

c++ - 虚拟机软件优化

已分配 Vagrant + Hyper V IPV6 地址

powershell - 通过计划任务运行的Powershell脚本,显示区域设置问题

powershell - 如何在 Windows Powershell 中转换数据类型?

powershell - Powershell获取服务-forgroundcolor

docker - 我应该在开发计算机上的哪里安装SQL Management Server实例?

amazon-web-services - 将 IIS 日志移动到 AWS s3 存储桶

virtualization - x86 虚拟化指令集(VT-x、AMD-V)是否有其他用途?

macos - 可以在没有嵌套虚拟化的情况下在 Hyper-V 上运行 MacOS 吗?