PowerShell: Get Quorums of All Clusters in the Domain

# getClusterQuorum.ps1

function getClusterQuorum{
    $allClusters=(get-cluster -domain $env:USERDNSDOMAIN).Name
    $results=@{}
    foreach ($cluster in $allClusters){
        $quorum=Get-ClusterQuorum -Cluster $cluster -ea SilentlyContinue
        if($quorum){
            $quorumResource=$quorum.QuorumResource
            $results+=@{$cluster=if($quorumResource){$quorumResource}else{'None'}}
        }else{
            $results+=@{$cluster='None'}
            }
        }
    return $results
}
getClusterQuorum

Leave a Reply

Your email address will not be published. Required fields are marked *