Skip to content

Instantly share code, notes, and snippets.

@suusan2go
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suusan2go/66289adf0bbf85f3529d to your computer and use it in GitHub Desktop.
Save suusan2go/66289adf0bbf85f3529d to your computer and use it in GitHub Desktop.
$Cl = Get-Cluster
$array = New-Object 'System.Collections.Generic.List[System.String]'
#fail over hostが持つIDを$arrrayに格納する。
foreach($a in $array) {
foreach($fh in $a.ExtensionData.Configuration.DasConfig.AdmissionControlPolicy.Failoverhosts){
$array.add($fh)
}
}
# ESXiホスト名 , HAホスト(true or false)で出力する
Get-VmHost | select Name,@{Name="is_fail_over_host";Expression=if($array -contains $_.id){echo $true}else{echo $false}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment