Partager via


Set-SCVirtualNetworkAdapterConfiguration

Modifies the virtual network adapter configuration contained within a virtual machine configuration.

Syntax

Set-SCVirtualNetworkAdapterConfiguration
   [-IPv4PAAddressPool <StaticIPAddressPool>]
   [-IPv4AddressPool <StaticIPAddressPool>]
   [-PinIPv4PAAddressPool <Boolean>]
   [-PinIPv4AddressPool <Boolean>]
   [-IPv6PAAddressPool <StaticIPAddressPool>]
   [-IPv6AddressPool <StaticIPAddressPool>]
   [-PinIPv6AddressPool <Boolean>]
   [-PinIPv6PAAddressPool <Boolean>]
   [-MACAddressPool <MACAddressPool>]
   [-PinMACAddressPool <Boolean>]
   [-IPv4PAAddress <String>]
   [-IPv4Address <String>]
   [-IPv6PAAddress <String>]
   [-IPv6Address <String>]
   [-MACAddress <String>]
   -VirtualNetworkAdapterConfiguration <VirtualNetworkAdapterConfiguration>
   [-VMSubnet <VMSubnet>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [<CommonParameters>]

Description

The Set-SCVirtualNetworkAdapterConfiguration cmdlet modifies the virtual network adapter configuration information that is contained within a virtual machine configuration.

Examples

Example 1: Set the properties of the virtual network adapter configuration for a virtual machine configuration

PS C:\> $ServiceConfig = Get-SCServiceConfiguration -Name "Service01"
PS C:\> $TierConfig = Get-SCComputerTierConfiguration -ServiceConfiguration $ServiceConfig
PS C:\> $VMConfig = Get-SCVMConfiguration -ComputerTierConfiguration $TierConfig
PS C:\> $VNAConfig = Get-SCVirtualNetworkAdapterConfiguration -VMConfiguration $VMConfig[0]
PS C:\> Set-SCVirtualNetworkAdapterConfiguration -VirtualNetworkAdapterConfiguration $VNAConfig -IPv4Address "10.255.234.155" -PinIPv4AddressPool $True

The first command gets the service configuration object named Service01 and stores the object in the $ServiceConfig variable.

The second command gets the computer tier configuration for the service configuration stored in $ServiceConfig and stores the object in the $TierConfig variable.

The third command gets the virtual machine configuration for the computer tier configuration stored in $TierConfig and stores the object in the $VMConfig variable.

The fourth command gets the virtual network adapter configuration for the first virtual machine configuration stored in $VMConfig and stores the object in the $VNAConfig variable.

The last command changes the IPv4Address property of the network adapter configuration stored in $VNAConfig, and pins the value of the IP address, which prevents it from being changed during placement.

Parameters

-IPv4Address

Specifies an IPv4 address.

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

-IPv4AddressPool

Specifies a static address pool that contains IPv4 addresses.

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

-IPv4PAAddress

Specifies a provider IP address in IPv4 format.

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

-IPv4PAAddressPool

Specifies a provider IP address pool that contains IP addresses in IPv4 format.

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

-IPv6Address

Specifies an IPv6 address.

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

-IPv6AddressPool

Specifies a static address pool that contains IPv6 addresses.

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

-IPv6PAAddress

Specifies a provider IP address in IPv6 format.

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

-IPv6PAAddressPool

Specifies a provider IP address pool that contains IP addresses in IPv6 format.

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

-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

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

-MACAddress

Specifies the media access control (MAC) address, or a set of MAC addresses, for a physical or virtual network adapter on a computer.

  • Example format for a single MAC address: -MACAddress "00-15-5D-B4-DC-00"
  • Example format for a set of MAC addresses: -MACAddress "00-15-5D-B4-DC-00", "00-1A-A0-E3-75-29"
Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MACAddressPool

Specifies a MAC address pool.

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

-PinIPv4AddressPool

Indicates whether the IPv4 address pool chosen by the user is retained during service deployment configuration.

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

-PinIPv4PAAddressPool

Indicates whether the IPv4 provider address pool chosen by the user is retained during service deployment configuration.

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

-PinIPv6AddressPool

Indicates whether the IPv6 address pool chosen by the user is retained during service deployment configuration.

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

-PinIPv6PAAddressPool

Indicates whether the IPv6 provider address pool chosen by the user is retained during service deployment configuration.

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

-PinMACAddressPool

Indicates whether the MAC address pool chosen by the user is retained during service deployment configuration.

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

-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

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

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

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

-VirtualNetworkAdapterConfiguration

Specifies a virtual network adapter configuration object.

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

-VMSubnet

Specifies a virtual machine subnet object.

To obtain a VMSubnet object, use the Get-SCVMSubnet cmdlet.

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

Outputs

VirtualNetworkAdapterConfiguration

This cmdlet returns a VirtualNetworkAdapterConfiguration object.