New-SCVMHostNetworkAdapterConfig
创建主机网络适配器配置。
语法
New-SCVMHostNetworkAdapterConfig
[-VMMServer <ServerConnection>]
[-SetAsPhysicalNetworkAdapter]
-LogicalSwitch <LogicalSwitch>
-UplinkPortProfileSet <UplinkPortProfileSet>
[-MACAddress <String>]
[-ConsistentDeviceName <String>]
[-DisableAdapterDNSRegistration <Boolean>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterConfig
[-VMMServer <ServerConnection>]
[-SetAsPhysicalNetworkAdapter]
[-SetAsGenericNIC]
[-UseStaticIPForIPConfiguration]
-LogicalNetwork <LogicalNetwork>
[-MACAddress <String>]
[-ConsistentDeviceName <String>]
[-IPv4Subnet <String>]
[-IPv6Subnet <String>]
[-IPv4Address <String>]
[-IPv6Address <String>]
[-DisableAdapterDNSRegistration <Boolean>]
[-AdapterName <String>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterConfig
[-VMMServer <ServerConnection>]
[-SetAsPhysicalNetworkAdapter]
[-SetAsManagementNIC]
[-UseDhcpForIPConfiguration]
[-MACAddress <String>]
[-ConsistentDeviceName <String>]
[-AdapterName <String>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterConfig
[-VMMServer <ServerConnection>]
[-SetAsPhysicalNetworkAdapter]
[-SetAsGenericNIC]
[-UseDhcpForIPConfiguration]
[-MACAddress <String>]
[-ConsistentDeviceName <String>]
[-DisableAdapterDNSRegistration <Boolean>]
[-AdapterName <String>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterConfig
[-VMMServer <ServerConnection>]
[-SetAsPhysicalNetworkAdapter]
[-SetAsManagementNIC]
[-UseStaticIPForIPConfiguration]
-LogicalNetwork <LogicalNetwork>
[-MACAddress <String>]
[-ConsistentDeviceName <String>]
[-IPv4Subnet <String>]
[-IPv6Subnet <String>]
[-IPv4Address <String>]
[-IPv6Address <String>]
[-AdapterName <String>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterConfig
[-VMMServer <ServerConnection>]
[-SetAsVirtualNetworkAdapter]
[-SetAsGenericNIC]
[-UseDhcpForIPConfiguration]
-LogicalSwitch <LogicalSwitch>
[-PortClassification <PortClassification>]
-VMNetwork <VMNetwork>
[-MACAddress <String>]
[-AdapterName <String>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterConfig
[-VMMServer <ServerConnection>]
[-SetAsVirtualNetworkAdapter]
[-SetAsGenericNIC]
[-UseStaticIPForIPConfiguration]
-LogicalSwitch <LogicalSwitch>
[-PortClassification <PortClassification>]
-VMNetwork <VMNetwork>
[-MACAddress <String>]
[-IPv4Subnet <String>]
[-IPv6Subnet <String>]
[-IPv4Address <String>]
[-IPv6Address <String>]
[-AdapterName <String>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterConfig
[-VMMServer <ServerConnection>]
[-SetAsVirtualNetworkAdapter]
[-SetAsManagementNIC]
-TransientManagementNetworkAdapter <PhysicalComputerNetworkAdapterConfig>
[-UseDhcpForIPConfiguration]
-LogicalSwitch <LogicalSwitch>
[-PortClassification <PortClassification>]
-VMNetwork <VMNetwork>
[-MACAddress <String>]
[-AdapterName <String>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterConfig
[-VMMServer <ServerConnection>]
[-SetAsVirtualNetworkAdapter]
[-SetAsManagementNIC]
-TransientManagementNetworkAdapter <PhysicalComputerNetworkAdapterConfig>
[-UseStaticIPForIPConfiguration]
-LogicalSwitch <LogicalSwitch>
[-PortClassification <PortClassification>]
-VMNetwork <VMNetwork>
[-MACAddress <String>]
[-IPv4Subnet <String>]
[-IPv6Subnet <String>]
[-IPv4Address <String>]
[-IPv6Address <String>]
[-AdapterName <String>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
说明
New-SCVMHostNetworkAdapterConfig cmdlet 创建主机网络适配器配置,该配置在主机操作系统部署过程中使用。
示例
示例 1:使用静态 IP 地址创建管理物理主机网络适配器配置
PS C:\> $LogicalNetwork = Get-SCLogicalNetwork -Name "LogicalNetwork01"
PS C:\> New-SCVMHostNetworkAdapterConfig -SetAsPhysicalNetworkAdapter -SetAsManagementNIC -UseStaticIPForIPConfiguration -LogicalNetwork $LogicalNetwork -MacAddress "00-1D-D8-B7-1C-00" -IPv4Subnet "10.0.0.1/24"
第一个命令获取名为 LogicalNetwork01 的逻辑网络对象,并将对象存储在$LogicalNetwork变量中。
第二个命令创建物理主机网络适配器配置,将其设置为管理网络适配器,并在 IP 配置期间使用静态 IP 地址。 配置包括 LogicalNetwork01、提供的 MAC 地址和指定的子网。
示例 2:创建使用逻辑交换机的物理主机网络适配器配置
PS C:\> $LogicalSwitch = Get-SCLogicalSwitch -Name "LogicalSwitch01"
PS C:\> $UplinkPortProfSet = Get-SCUplinkPortProfileSet -Name "UplinkPortProfileSet01"
PS C:\> New-SCVMHostNetworkAdapterConfig -SetAsPhysicalNetworkAdapter -LogicalSwitch $LogicalSwitch -UplinkPortProfileSet $UplinkPortProfSet
第一个命令获取名为 LogicalSwitch01 的逻辑交换机对象,并将对象存储在$LogicalSwitch变量中。
第二个命令获取名为 UplinkPortProfileSet01 的上行端口配置文件集对象,并将对象存储在$UplinkPortProfSet变量中。
最后一个命令使用 LogicalSwitch01 和 UplinkPortProfileSet01 创建物理主机网络适配器配置。
示例 3:使用 DHCP 创建通用虚拟主机网络适配器配置
PS C:\> $LogicalSwitch = Get-SCLogicalSwitch -Name "LogicalSwitch01"
PS C:\> $VMNetwork = Get-SCVMNetwork -Name "VMNetwork01"
PS C:\> New-SCVMHostNetworkAdapterConfig -SetAsVirtualNetworkAdapter -SetAsGenericNIC -UseDhcpForIPConfiguration -LogicalSwitch $LogicalSwitch -VMNetwork $VMNetwork
第一个命令获取名为 LogicalSwitch01 的逻辑交换机对象,并将对象存储在$LogicalSwitch变量中。
第二个命令获取名为 VMNetwork01 的 VM 网络对象,并将对象存储在$VMNetwork变量中。
最后一个命令使用 LogicalSwtich01 和 VMNetwork01 创建通用虚拟主机网络配置,该配置使用 DHCP 获取 IP 地址。
参数
-AdapterName
指定网络适配器的名称。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ConsistentDeviceName
指定网络适配器的一致设备名称。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisableAdapterDNSRegistration
指示是否禁用网络适配器的 DNS 注册。
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IPv4Address
指定 IPv4 地址。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IPv4Subnet
指定 IPv4 子网。
Type: | String |
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 |
-IPv6Subnet
指定 IPv6 子网。
Type: | String |
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 |
-LogicalNetwork
指定逻辑网络。 逻辑网络是 IP 子网和 VLAN 的命名分组,用于组织和简化网络分配。
Type: | LogicalNetwork |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LogicalSwitch
指定逻辑交换机对象。
Type: | LogicalSwitch |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MACAddress
为计算机上的物理或虚拟网络适配器指定媒体访问控制 (MAC) 地址或一组 MAC 地址。 有效值为:一个或多个 MAC 地址。
单个 MAC 地址的示例格式:
-MACAddress "00-15-5D-B4-DC-00"
一组 MAC 地址的示例格式:
-MACAddress "00-15-5D-B4-DC-00", "00-1A-A0-E3-75-29"
一组 MAC 地址的示例格式:
$Macs = "00-15-5D-B4-DC-00", "00-1A-A0-E3-75-29"
Set-SCPXEServer -MACAddress $Macs
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PortClassification
指定虚拟网络适配器连接到的交换机的端口分类。
Type: | PortClassification |
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 |
-SetAsGenericNIC
指示网络适配器不是主机的管理网络适配器。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SetAsManagementNIC
指示网络适配器是主机的管理网络适配器。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SetAsPhysicalNetworkAdapter
指示网络适配器是物理网络适配器。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SetAsVirtualNetworkAdapter
指示网络适配器是虚拟网络适配器。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TransientManagementNetworkAdapter
指定管理虚拟网络适配器在初始操作系统部署阶段绑定到的物理网络适配器。 在部署主机之前临时使用此属性。
Type: | PhysicalComputerNetworkAdapterConfig |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UplinkPortProfileSet
指定上行端口配置文件集对象。
若要获取上行端口配置文件集对象,请使用 Get-SCUplinkPortProfileSet cmdlet。
Type: | UplinkPortProfileSet |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UseDhcpForIPConfiguration
指示使用 DHCP 获取网络适配器的 IP 地址。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UseStaticIPForIPConfiguration
指示网络适配器是使用静态 IP 地址配置的。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VMMServer
指定VMM 服务器对象。
Type: | ServerConnection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-VMNetwork
指定 VM 网络对象。
若要获取 VM 网络对象,请使用 Get-SCVMNetwork cmdlet。
Type: | VMNetwork |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
输出
HostNetworkAdapterConfig
此 cmdlet 返回 HostNetworkAdapterConfig 对象。