Set-SCVirtualNetworkAdapterConfiguration
修改虚拟机配置中包含的虚拟网络适配器配置。
语法
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>]
说明
Set-SCVirtualNetworkAdapterConfiguration cmdlet 修改虚拟机配置中包含的虚拟网络适配器配置信息。
示例
示例 1:设置虚拟机配置的虚拟网络适配器配置的属性
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
第一个命令获取名为 Service01 的服务配置对象,并将对象存储在$ServiceConfig变量中。
第二个命令获取存储在$ServiceConfig中的服务配置的计算机层配置,并将对象存储在$TierConfig变量中。
第三个命令获取存储在$TierConfig中的计算机层配置的虚拟机配置,并将对象存储在$VMConfig变量中。
第四个命令获取存储在$VMConfig中的第一个虚拟机配置的虚拟网络适配器配置,并将对象存储在$VNAConfig变量中。
最后一个命令更改存储在$VNAConfig中的网络适配器配置的 IPv4Address 属性,并固定 IP 地址的值,从而防止在放置期间更改 IP 地址。
参数
-IPv4Address
指定 IPv4 地址。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IPv4AddressPool
指定包含 IPv4 地址的静态地址池。
Type: | StaticIPAddressPool |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IPv4PAAddress
指定 IPv4 格式的提供程序 IP 地址。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IPv4PAAddressPool
指定提供程序 IP 地址池,其中包含 IPv4 格式的 IP 地址。
Type: | StaticIPAddressPool |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IPv6Address
指定 IPv6 地址。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IPv6AddressPool
指定包含 IPv6 地址的静态地址池。
Type: | StaticIPAddressPool |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IPv6PAAddress
指定 IPv6 格式的提供程序 IP 地址。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IPv6PAAddressPool
指定提供程序 IP 地址池,其中包含 IPv6 格式的 IP 地址。
Type: | StaticIPAddressPool |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JobVariable
指定跟踪作业进度,并将其存储在此参数命名的变量中。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MACAddress
指定计算机上的物理或虚拟网络适配器的媒体访问控制 (MAC) 地址或一组 MAC 地址。
- 单个 MAC 地址的示例格式:
-MACAddress "00-15-5D-B4-DC-00"
- 一组 MAC 地址的示例格式:
-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
指定 MAC 地址池。
Type: | MACAddressPool |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PinIPv4AddressPool
指示用户在服务部署配置期间是否保留用户选择的 IPv4 地址池。
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PinIPv4PAAddressPool
指示用户在服务部署配置期间是否保留用户选择的 IPv4 提供程序地址池。
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PinIPv6AddressPool
指示用户在服务部署配置期间是否保留用户选择的 IPv6 地址池。
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PinIPv6PAAddressPool
指示用户在服务部署配置期间是否保留用户选择的 IPv6 提供程序地址池。
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PinMACAddressPool
指示用户在服务部署配置期间是否保留用户选择的 MAC 地址池。
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PROTipID
指定触发此操作 (PRO 提示) 的性能和资源优化提示的 ID。 此参数允许审核 PRO 提示。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsynchronously
指示作业异步运行,以便控件立即返回到命令 shell。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VirtualNetworkAdapterConfiguration
指定虚拟网络适配器配置对象。
Type: | VirtualNetworkAdapterConfiguration |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-VMSubnet
指定虚拟机子网对象。
若要获取 VMSubnet 对象,请使用 Get-SCVMSubnet cmdlet。
Type: | VMSubnet |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
输出
VirtualNetworkAdapterConfiguration
此 cmdlet 返回 VirtualNetworkAdapterConfiguration 对象。