应该只返回 SCVMM 中可用的主机列表,而不是它的详细信息。
使用此脚本,您将获得主机列表以及第一个主机的详细信息。
要运行此脚本,您需要 VMM powershell 模块,该模块仅在安装了 VMM 控制台的地方可用。
## Import VMM module
Import-Module VirtualMachineManager
## Get the VMM server
Get-VMMServer "vmm.contoso.com" | out-null
## Get all hosts managed by the VMM server.
$Hosts = Get-SCVMHost
## Print the hosts list
Write-Host $Hosts
## With this line you gonna print all the attributes of the first host:
$Hosts[0]
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句