Posted On August 21, 2020

PowerShell: Get Quorums of All Clusters in the Domain

kimconnect 0 comments
blog.KimConnect.com >> Codes , Virtualization >> 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 *

Related Post

PowerShell: Combine Objects

By default, a PowerShell Custom Object cannot be added to another. This would be the…

PowerShell: Obtain Domain Admin Credential and Save It as an XML for Subsequent Execution

Working Version: # Initialize with defaults$credFileExists=$False# This function is a workaround to the issue of…

PowerShell: File Copy Script using EmCopy & VSS (Legacy)

The script below is for informational purposes. Here is a better version <#.Description FileCopyScript_v1.1.8.ps1 Note: this…