Set-VMNetworkAdapterFailoverConfiguration

Set-VMNetworkAdapterFailoverConfiguration

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

構文

Parameter Set: VMName
Set-VMNetworkAdapterFailoverConfiguration [-VMName] <String> [-CimSession <Microsoft.Management.Infrastructure.CimSession[]> ] [-ClearFailoverIPv4Settings] [-ClearFailoverIPv6Settings] [-ComputerName <String[]> ] [-Credential <System.Management.Automation.PSCredential[]> ] [-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] <VMNetworkAdapter> [-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>]

詳細説明

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.

パラメーター

-CimSession<Microsoft.Management.Infrastructure.CimSession[]>

リモート セッションまたはリモート コンピューターでコマンドレットを実行します。コンピューター名またはセッション オブジェクト (New-CimSession コマンドレットや Get-CimSession コマンドレットの出力など) を入力します。既定値は、ローカル コンピューター上の現在のセッションです。

Aliases

none

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-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

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

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

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

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

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-Credential<System.Management.Automation.PSCredential[]>

Specifies one or more user accounts that have permission to perform this action. The default is the current user.

Aliases

none

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-Passthru

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

Aliases

none

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-VM<VirtualMachine>

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

Aliases

none

必須/オプション

true

位置

1

既定値

none

パイプライン入力の受け入れ

True (ByValue)

ワイルドカード文字の受け入れ

false

-VMName<String>

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

Aliases

none

必須/オプション

true

位置

1

既定値

none

パイプライン入力の受け入れ

True (ByValue)

ワイルドカード文字の受け入れ

false

-VMNetworkAdapter<VMNetworkAdapter>

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

Aliases

none

必須/オプション

true

位置

1

既定値

none

パイプライン入力の受け入れ

True (ByValue, ByPropertyName)

ワイルドカード文字の受け入れ

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

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

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

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-IPv4DefaultGateway<String>

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

Aliases

none

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-IPv4PreferredDNSServer<String>

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

Aliases

none

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

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

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

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

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-IPv6AlternateDNSServer<String>

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

Aliases

none

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-IPv6DefaultGateway<String>

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

Aliases

none

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-IPv6PreferredDNSServer<String>

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

Aliases

none

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

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

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-VMNetworkAdapterName<String>

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

Aliases

none

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-Confirm

コマンドレットを実行する前に確認メッセージを表示します。

必須/オプション

false

位置

named

既定値

false

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-WhatIf

コマンドレットが実行された場合に何が起きるのかを示します。コマンドレットは実行されません。

必須/オプション

false

位置

named

既定値

false

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

<CommonParameters>

このコマンドレットは共通のパラメーターをサポートしています(-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、および -OutVariable)。詳細については、TechNet の「 「about_CommonParameters」 (https://go.microsoft.com/fwlink/p/?LinkID=113216) を参照してください。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットが出力するオブジェクトの型です。

  • None by default; Microsoft.HyperV.PowerShell.VMNetworkAdapterFailoverConfiguration if –PassThru is specified.

使用例

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