none
Powershell how to set the parameter of ClusterGroup RRS feed

  • Question

  • how to use the command in the url.somebody can provider some examples to change the "FailoverThreshold" parameter of ClusterGroup

    https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/ee460993(v=technet.10)?redirectedfrom=MSDN

    Tuesday, September 20, 2022 11:03 AM

Answers

  • Set-ClusterParameter

    Controls specific properties of an object in a failover cluster, such as a resource, a group, or a network.

    Syntax
    PowerShell

    Copy
    Set-ClusterParameter
       [-InputObject <PSObject>]
       [-Create]
       [-Delete]
       [-Cluster <String>]
       [<CommonParameters>]
    PowerShell

    Copy
    Set-ClusterParameter
       [-InputObject <PSObject>]
       [[-Name] <String>]
       [[-Value] <PSObject>]
       [-Create]
       [-Delete]
       [-Cluster <String>]
       [<CommonParameters>]
    PowerShell

    Copy
    Set-ClusterParameter
       [-InputObject <PSObject>]
       [[-Multiple] <Hashtable>]
       [-Create]
       [-Delete]
       [-Cluster <String>]
       [<CommonParameters>]
    Description
    The Set-ClusterParameter cmdlet controls specific properties of an object in a failover cluster, such as a resource, a group, or a network.

    -- For a disk resource, you can set the disk signature or GUID of a disk, and turn maintenance on or off for that disk.

    -- For a Network Name resource, you can set DNS-related information about the resource.

    -- For an IP address resource, you can set DHCP-related information about the IP Address resource.

    -- For resources used by virtual machines, you can set details about the settings for the virtual machines.

    Examples
    Example 1
    PowerShell

    Copy
    PS C:\> Get-ClusterResource -Name cluster1FS | Set-ClusterParameter -Name HostRecordTTL -Value 300
    This example configures the clustered resource called cluster1FS on the local cluster, by setting the value of HostRecordTTL to 300.

    Example 2
    PowerShell

    Copy
    PS C:\> Get-ClusterResource -Name "Cluster IP Address" | Set-ClusterParameter -Multiple @{"Address"="172.24.22.168";"Network"="Cluster Network 2";"EnableDhcp"=1}
    This example uses the Multiple parameter to configure the clustered resource called Cluster IP Address, by setting the Address, Network, and EnableDhcp parameters simultaneously.

    Example 3
    PowerShell

    Copy
    PS C:\> $res = Get-ClusterResource -Name "IP Address"



    PS C:\> $param1 = New-Object -ComObject Microsoft.FailoverClusters.PowerShell.ClusterParameter -Property $res,Address,10.55.88.46



    PS C:\> $param2 = New-Object -ComObject Microsoft.FailoverClusters.PowerShell.ClusterParameter -Property $res,SubnetMask,255.0.0.0



    PS C:\> $params = $param1,$param2



    PS C:\> $params | Set-ClusterParameter
    This example configures the clustered resource called IP Address to use a new static IP. Because the new address and subnet mask are required, both parameters must be passed to this cmdlet together.

    Parameters
    -Cluster
    Type: String
    "white-space:pre;"> Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    -Create
    Type: SwitchParameter
    "white-space:pre;"> Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    -Delete
    Type: SwitchParameter
    "white-space:pre;"> Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    -InputObject
    Type: PSObject
    "white-space:pre;"> Named
    Default value: None
    Accept pipeline input: True
    Accept wildcard characters: False
    -Multiple
    Type: Hashtable
    "white-space:pre;"> 0
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    -Name
    Type: String
    "white-space:pre;"> 0
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    -Value
    Type: PSObject
    "white-space:pre;"> 1
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    Inputs
    Microsoft.FailoverClusters.PowerShell.Cluster

    Microsoft.FailoverClusters.PowerShell.ClusterGroup

    Microsoft.FailoverClusters.PowerShell.ClusterNetwork

    Microsoft.FailoverClusters.PowerShell.ClusterNetworkInterface

    Microsoft.FailoverClusters.PowerShell.ClusterNode

    Microsoft.FailoverClusters.PowerShell.ClusterParameter

    Microsoft.FailoverClusters.PowerShell.ClusterResource

    Microsoft.FailoverClusters.PowerShell.ClusterResourceType

    Microsoft.FailoverClusters.PowerShell.ClusterSharedVolume

    This may help you,

    Rachel Gomez

    • Marked as answer by JonasZhan Saturday, September 24, 2022 12:08 PM
    Saturday, September 24, 2022 4:47 AM

All replies

  • Set-ClusterParameter

    Controls specific properties of an object in a failover cluster, such as a resource, a group, or a network.

    Syntax
    PowerShell

    Copy
    Set-ClusterParameter
       [-InputObject <PSObject>]
       [-Create]
       [-Delete]
       [-Cluster <String>]
       [<CommonParameters>]
    PowerShell

    Copy
    Set-ClusterParameter
       [-InputObject <PSObject>]
       [[-Name] <String>]
       [[-Value] <PSObject>]
       [-Create]
       [-Delete]
       [-Cluster <String>]
       [<CommonParameters>]
    PowerShell

    Copy
    Set-ClusterParameter
       [-InputObject <PSObject>]
       [[-Multiple] <Hashtable>]
       [-Create]
       [-Delete]
       [-Cluster <String>]
       [<CommonParameters>]
    Description
    The Set-ClusterParameter cmdlet controls specific properties of an object in a failover cluster, such as a resource, a group, or a network.

    -- For a disk resource, you can set the disk signature or GUID of a disk, and turn maintenance on or off for that disk.

    -- For a Network Name resource, you can set DNS-related information about the resource.

    -- For an IP address resource, you can set DHCP-related information about the IP Address resource.

    -- For resources used by virtual machines, you can set details about the settings for the virtual machines.

    Examples
    Example 1
    PowerShell

    Copy
    PS C:\> Get-ClusterResource -Name cluster1FS | Set-ClusterParameter -Name HostRecordTTL -Value 300
    This example configures the clustered resource called cluster1FS on the local cluster, by setting the value of HostRecordTTL to 300.

    Example 2
    PowerShell

    Copy
    PS C:\> Get-ClusterResource -Name "Cluster IP Address" | Set-ClusterParameter -Multiple @{"Address"="172.24.22.168";"Network"="Cluster Network 2";"EnableDhcp"=1}
    This example uses the Multiple parameter to configure the clustered resource called Cluster IP Address, by setting the Address, Network, and EnableDhcp parameters simultaneously.

    Example 3
    PowerShell

    Copy
    PS C:\> $res = Get-ClusterResource -Name "IP Address"



    PS C:\> $param1 = New-Object -ComObject Microsoft.FailoverClusters.PowerShell.ClusterParameter -Property $res,Address,10.55.88.46



    PS C:\> $param2 = New-Object -ComObject Microsoft.FailoverClusters.PowerShell.ClusterParameter -Property $res,SubnetMask,255.0.0.0



    PS C:\> $params = $param1,$param2



    PS C:\> $params | Set-ClusterParameter
    This example configures the clustered resource called IP Address to use a new static IP. Because the new address and subnet mask are required, both parameters must be passed to this cmdlet together.

    Parameters
    -Cluster
    Type: String
    "white-space:pre;"> Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    -Create
    Type: SwitchParameter
    "white-space:pre;"> Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    -Delete
    Type: SwitchParameter
    "white-space:pre;"> Named
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    -InputObject
    Type: PSObject
    "white-space:pre;"> Named
    Default value: None
    Accept pipeline input: True
    Accept wildcard characters: False
    -Multiple
    Type: Hashtable
    "white-space:pre;"> 0
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    -Name
    Type: String
    "white-space:pre;"> 0
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    -Value
    Type: PSObject
    "white-space:pre;"> 1
    Default value: None
    Accept pipeline input: False
    Accept wildcard characters: False
    Inputs
    Microsoft.FailoverClusters.PowerShell.Cluster

    Microsoft.FailoverClusters.PowerShell.ClusterGroup

    Microsoft.FailoverClusters.PowerShell.ClusterNetwork

    Microsoft.FailoverClusters.PowerShell.ClusterNetworkInterface

    Microsoft.FailoverClusters.PowerShell.ClusterNode

    Microsoft.FailoverClusters.PowerShell.ClusterParameter

    Microsoft.FailoverClusters.PowerShell.ClusterResource

    Microsoft.FailoverClusters.PowerShell.ClusterResourceType

    Microsoft.FailoverClusters.PowerShell.ClusterSharedVolume

    This may help you,

    Rachel Gomez

    • Marked as answer by JonasZhan Saturday, September 24, 2022 12:08 PM
    Saturday, September 24, 2022 4:47 AM
  • Thanks for your reply!!

    I have get my answer.

    The Set-ClusterParameter is used to set the private properties of the cluster object. Public properties like FailoverThreshold can be set directly。

    (Get-ClusterGroup -Name $GroupName).FailoverThreshold = 5

    Saturday, September 24, 2022 12:08 PM