Condividi tramite


Set-VMNetworkAdapterFailoverConfiguration

Set-VMNetworkAdapterFailoverConfiguration

Configures the IP address of a virtual network adapter to be used when a virtual machine fails over.

Syntax

Parameter Set: VMName
Set-VMNetworkAdapterFailoverConfiguration [-VMName] <String> [-ClearFailoverIPv4Settings] [-ClearFailoverIPv6Settings] [-ComputerName <String[]> ] [-IPv4Address <String> ] [-IPv4AlternateDNSServer <String> ] [-IPv4DefaultGateway <String> ] [-IPv4PreferredDNSServer <String> ] [-IPv4SubnetMask <String> ] [-IPv6Address <String> ] [-IPv6AlternateDNSServer <String> ] [-IPv6DefaultGateway <String> ] [-IPv6PreferredDNSServer <String> ] [-IPv6SubnetPrefixLength <Int32> ] [-PassThru] [-VMNetworkAdapterName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: ResourceObject
Set-VMNetworkAdapterFailoverConfiguration [-VMNetworkAdapter] <VMNetworkAdapterBase> [-ClearFailoverIPv4Settings] [-ClearFailoverIPv6Settings] [-IPv4Address <String> ] [-IPv4AlternateDNSServer <String> ] [-IPv4DefaultGateway <String> ] [-IPv4PreferredDNSServer <String> ] [-IPv4SubnetMask <String> ] [-IPv6Address <String> ] [-IPv6AlternateDNSServer <String> ] [-IPv6DefaultGateway <String> ] [-IPv6PreferredDNSServer <String> ] [-IPv6SubnetPrefixLength <Int32> ] [-PassThru] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: VMObject
Set-VMNetworkAdapterFailoverConfiguration [-VM] <VirtualMachine> [-ClearFailoverIPv4Settings] [-ClearFailoverIPv6Settings] [-IPv4Address <String> ] [-IPv4AlternateDNSServer <String> ] [-IPv4DefaultGateway <String> ] [-IPv4PreferredDNSServer <String> ] [-IPv4SubnetMask <String> ] [-IPv6Address <String> ] [-IPv6AlternateDNSServer <String> ] [-IPv6DefaultGateway <String> ] [-IPv6PreferredDNSServer <String> ] [-IPv6SubnetPrefixLength <Int32> ] [-PassThru] [-VMNetworkAdapterName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Set-VMNetworkAdapterFailoverConfiguration cmdlet sets the configuration of an IP address of a virtual network adapter to be used when a virtual machine fails over.

Parameters

-ClearFailoverIPv4Settings

Clears the configured IPv4 failover settings. The IPv4 address configured in the primary virtual machine (static or dynamic) will be used by the Replica virtual machine.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ClearFailoverIPv6Settings

Clears the configured IPv6 failover settings. The IPv6 address configured in the primary virtual machine (static or dynamic) will be used by the Replica virtual machine.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ComputerName<String[]>

Specifies one or more Hyper-V hosts on which the IP address configuration of a virtual network adapter is to be set. NetBIOS names, IP addresses, and fully-qualified domain names are allowable. The default is the local computer — use “localhost” or a dot (“.”) to specify the local computer explicitly.

Aliases

none

Required?

false

Position?

named

Default Value

.

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VM<VirtualMachine>

Specifies the virtual machine for which you want to configure the IP address.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-VMName<String>

Specifies the friendly name of the virtual machine for which you want to configure the IP address.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-VMNetworkAdapter<VMNetworkAdapterBase>

Specifies the virtual network adapter for which you want to configure the IP address.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-IPv4Address<String>

Specifies the IPv4 address to set on the VMNetworkAdapter for use on failover of the virtual machine. You must also specify the IPv4SubnetMask parameter when you specify this parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-IPv4AlternateDNSServer<String>

Specifies the IPv4 alternate DNS server to be set on the VMNetworkAdapter for use on failover of the virtual machine.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-IPv4DefaultGateway<String>

Specifies the IPv4 default gateway to be set on VMNetworkAdapter for use on failover of the virtual machine..

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-IPv4PreferredDNSServer<String>

Specifies the IPv4 preferred DNS server to be set on VMNetworkAdapter for use on failover of the virtual machine.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-IPv4SubnetMask<String>

Specifies the IPv4 subnet mask to be set on VMNetworkAdapter for use on failover of the virtual machine. You must specify the IPv4Address parameter when you specify this parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-IPv6Address<String>

Specifies the IPv6 address to be set on VMNetworkAdapter for use on failover of the virtual machine. You must specify the IPv6SubnetPrefixLength parameter when you specify this parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-IPv6AlternateDNSServer<String>

Specifies the IPv6 alternate DNS server to be set on VMNetworkAdapter for use on failover of the virtual machine.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-IPv6DefaultGateway<String>

Specifies the IPv6 default gateway to be set on VMNetworkAdapter for use on failover of the virtual machine.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-IPv6PreferredDNSServer<String>

Specifies the IPv6 preferred DNS server to be set on VMNetworkAdapter for use on failover of the virtual machine.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-IPv6SubnetPrefixLength<Int32>

Specifies the IPv6 subnet prefix length to be set on VMNetworkAdapter for use on failover of the virtual machine. You must specify the IPv6Address parameter when you specify this parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PassThru

Specifies that a Microsoft.Virtualization.Powershell.VMNetworkAdapterFailoverConfiguration object is to be passed through to the pipeline representing the IP address configuration to be set.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMNetworkAdapterName<String>

Specifies the name of the virtual network adapter for which you want to set the IP address.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • None by default; Microsoft.Virtualization.Powershell.VMNetworkAdapterFailoverConfiguration if –PassThru is specified.

Examples

Example 1

This example configures a failover IPv4 address for virtual network adapter NetworkAdapter01 on virtual machine VM01.

PS C:\> Get-VMNetworkAdapter VM01 NetworkAdapter01 | Set-VMNetworkAdapterFailoverConfiguration –IPv4Address 10.100.1.100 –IPv4SubnetMask 255.255.255.0

Example 2

This example clears the current failover IPv4 settings on virtual network adapter NetworkAdapter01 for virtual machine VM01.

PS C:\> Get-VMNetworkAdapter VM01 NetworkAdapter01 | Set-VMNetworkAdapterFailoverConfiguration –ClearFailoverIPv4Settings

Example 3

This example configures an IPv6 address and a prefix length of 12 for a virtual network adapter NetworkAdapter01 for virtual machine VM01.

PS C:\> Get-VMNetworkAdapter VM01 NetworkAdapter01 | Set-VMNetworkAdapterFailoverConfiguration –Ipv6Address aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:aaa:aaaa –Ipv6SubnetPrefixLength 12

Example 4

This example clears the current failover IPv6 settings on a virtual network adapter NetworkAdapter01 for virtual machine VM01.

PS C:\> Get-VMNetworkAdapter VM01 NetworkAdapter01 | Set-VMNetworkAdapterFailoverConfiguration –ClearFailoverIPv6Settings