編輯

共用方式為


Get-Cluster

Gets information about one or more failover clusters in a given domain.

Syntax

Get-Cluster
   [[-Name] <String>]
   [-Domain <String>]
   [<CommonParameters>]

Description

The Get-Cluster cmdlet gets information about one or more failover clusters in a given domain.

This cmdlet can obtain a variety of configuration and state information about a failover cluster, including the following items:

  • State information about whether a backup is in progress.
  • State information about whether the cluster is in a forced quorum state.
  • Cross-network settings that are especially relevant for multi-site clusters.

To set a common property for the cluster, use this cmdlet to get the cluster object and then set the appropriate property on that cluster object directly.

Examples

Example 1

Get-Cluster | Format-List -Property *

This example displays state and property information for the local cluster in the form of a list.

Example 2

Get-Cluster -Name cluster1

This example gets information about a cluster named cluster1.

Example 3

Get-Cluster -Domain contoso.com

This example gets information about each of the clusters in the contoso.com domain.

Example 4

Get-Cluster | ForEach-Object -Process {$_.CrossSubnetDelay = 1500}

This example sets the common property called CrossSubnetDelay for the local cluster to 1500.

Example 5

(Get-Cluster).DynamicQuorum = 1

This example enables the Dynamic Quorum feature for the cluster.

Example 6

Get-Cluster | Format-List -Property Quarantine*

This example shows default values for QuarantineThreshold and QuarantineDuration for the local cluster.

  • QuarantineThreshold: This is the number of times that a node can become isolated in an hour before the cluster will be quarantined. This is set to 3 by default.
  • QuarantineDuration: This setting, set to 7200 seconds or 2 hours by default, controls how long a host will remain quarantined.

Example 7

(Get-Cluster).MaximumParallelMigrations = 2

Beginning with the 2022-09 Cumulative Update, you can now configure the number of parallel live migrations within a cluster. For more information, see KB5017381 for Windows Server 2022 and KB5017382 for Azure Stack HCI, version 21H2.

This example sets the cluster property MaximumParallelMigrations to a value of 2, limiting the number of live migrations that a cluster node can participate in. Both existing and new cluster nodes inherit this value of 2 because it's a cluster property. Setting the cluster property overrides any values configured using the Set-VMHost command.

Parameters

-Domain

Specifies the name of the domain in which to enumerate clusters.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of the cluster to get.

Type:String
Position:0
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

Microsoft.FailoverClusters.PowerShell.Cluster