This is an archive version of the document. To get the most up-to-date information, see the current version.

Set-VBRFailoverPlan

In this article

    Short Description

    Modifies a selected failover plan or cloud failover plan.

    Applies to

    Platform: VMware, Hyper-V

    Product Edition: Enterprise, Enterprise Plus

    Syntax

    Set-VBRFailoverPlan -FailoverPlan <VBRFailoverPlan> [-Name <string>] [-Description <string>] [-FailoverPlanObject <VBRFailoverPlanObject[]>] [-PrefailoverCommand <string>] [-PostfailoverCommand <string>] [-EnablePublicIpRule] [-PassThru]  [<CommonParameters>]

    Related Commands

    New-VBRFailoverPlanObject

    Return Type

    VBRFailoverPlan

    Detailed Description

    This cmdlet modifies settings of an existing failover plan or cloud failover plan. To modify settings, you need to enter the corresponding parameters with new values. The parameters that you omit will remain unchanged.

    Parameters

    Parameter

    Description

    Required

    Position

    Accept
    Pipeline
    Input

    Accept
    Wildcard
    Characters

    FailoverPlan

    Specifies the failover plan or cloud failover plan you want to modify.

    Accepts VBRFailoverPlan or VBRCloudFailoverPlan object.

    True

    Named

    True (by Value
    FromPipeline,
    ValueFromPipeline
    ByPropertyName)

    False

    Name

    Specifies the new name you want to assign to the failover plan.

    False

    Named

    False

    False

    Failover
    Plan
    Object

    Specifies the VM(s) or cloud VM(s) you want to add to the failover plan.

    Accepts VBRFailoverPlanObject or VBRCloudFailoverPlanObject object.

    You can assign multiple VMs to this object.

    False

    Named

    False

    False

    Description

    Specifies the new description you want to apply to the failover plan.

    False

    Named

    False

    False

    PrefailoverCommand

    Specifies the path to the script you want to automatically run before failing over to replicas.

    False

    Named

    False

    False

    PostfailoverCommand

    Specifies the path to the script you want to automatically run after failing over to replicas is complete.

    False

    Named

    False

    False

    Enable
    Public
    IpRule

    If set, the failover plan will use the public IP rules configured in the VBRFailoverPlanObject or VBRCloudFailoverPlanObject.

    False

    Named

    False

    False

    PassThru

    Indicates that the command returns the output object to the Windows PowerShell console.

    False

    Named

    False

    False

    <CommonParameters>

    This cmdlet supports Microsoft PowerShell common parameters. For more information about common parameters, see http://go.microsoft.com/fwlink/p/?LinkID=113216.

    Example 1

    This command adds one more server to the failover plan named "MS Exchange Group Failover".

    1. Create a new failover plan object for the new VM. For details, see New-VBRFailoverPlanObject. Save the object to the $MSExchangeServer03 variable.
    2. Run Get-VBRFailoverPlan to get the failover plan and save it to the '$MSExchangePlan' variable.
    3. Get the VMs (failover plan objects) that are currently in the failover plan. Save the array to the $MSExchangeGroup variable.
    4. Add the new failover plan object to the array.
    5. Run Set-VBRFailoverPlan using the $MSExchangePlan variable and the updated array of the failover plan objects.

    PS C:\PS> $MSExchangeServer03 = Find-VBRViEntity -Name "MS Exchange Server 03"

    PS C:\PS> $MSExchangePlan = Get-VBRFailoverPlan -Name "MS Exchange Group Failover"

    PS C:\PS> $MSExchangeGroup = $MSExchangePlan.FailoverObject

    PS C:\PS> $MSExchangeGroup += $MSExchangeServer03

    PS C:\PS> Set-VBRFailoverPlan -FailoverPlan $MSExchangePlan -FailoverPlanObject $MSExchangeGroup -Description "Failover plan for the mail servers group: UPDATED"

    Example 2

    [Cloud provider] This command adds a pre-failover script to a tenant failover plan named "ABC Company Failover Plan".

    1. Run Get-VBRFailoverPlan to get the failover plan of the tenant stored in the $tenant variable. Save the failover plan to the $failoverplan variable.
    2. Run Set-VBRFailoverPlan with the $failoverplan variable. Use the -PrefailoverCommand parameter to add the path to the script to the failover plan.

    PS C:\PS> $failoverplan = Get-VBRFailoverPlan -Tenant $tenant -Name "ABC Company Failover Plan"

    PS C:\PS> Set-VBRFailoverPlan -FailoverPlan $failoverplan -PrefailoverCommand "C:\Users\Administrator\TriggerEmailNotification.cmd"