New-SCVMHostNetworkAdapterProfile
建立主機網路介面卡設定檔。
Syntax
New-SCVMHostNetworkAdapterProfile
[-VMMServer <ServerConnection>]
[-SetAsPhysicalNetworkAdapter]
[-SetAsGenericNIC]
[-ConsistentDeviceName <String>]
[-UseDhcpForIPConfiguration]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterProfile
[-VMMServer <ServerConnection>]
[-SetAsPhysicalNetworkAdapter]
[-SetAsManagementNIC]
[-ConsistentDeviceName <String>]
[-UseDhcpForIPConfiguration]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterProfile
[-VMMServer <ServerConnection>]
[-SetAsPhysicalNetworkAdapter]
[-SetAsGenericNIC]
[-ConsistentDeviceName <String>]
[-UseStaticIPForIPConfiguration]
-LogicalNetwork <LogicalNetwork>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterProfile
[-VMMServer <ServerConnection>]
[-SetAsPhysicalNetworkAdapter]
[-ConsistentDeviceName <String>]
-LogicalSwitch <LogicalSwitch>
-UplinkPortProfileSet <UplinkPortProfileSet>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterProfile
[-VMMServer <ServerConnection>]
[-SetAsPhysicalNetworkAdapter]
[-SetAsManagementNIC]
[-ConsistentDeviceName <String>]
[-UseStaticIPForIPConfiguration]
-LogicalNetwork <LogicalNetwork>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterProfile
[-VMMServer <ServerConnection>]
[-SetAsVirtualNetworkAdapter]
[-SetAsManagementNIC]
-TransientManagementNetworkAdapter <PhysicalComputerNetworkAdapterProfile>
[-UseStaticIPForIPConfiguration]
-LogicalSwitch <LogicalSwitch>
[-PortClassification <PortClassification>]
-VMNetwork <VMNetwork>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterProfile
[-VMMServer <ServerConnection>]
[-SetAsVirtualNetworkAdapter]
[-SetAsGenericNIC]
[-UseDhcpForIPConfiguration]
-LogicalSwitch <LogicalSwitch>
[-PortClassification <PortClassification>]
-VMNetwork <VMNetwork>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterProfile
[-VMMServer <ServerConnection>]
[-SetAsVirtualNetworkAdapter]
[-SetAsGenericNIC]
[-UseStaticIPForIPConfiguration]
-LogicalSwitch <LogicalSwitch>
[-PortClassification <PortClassification>]
-VMNetwork <VMNetwork>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
New-SCVMHostNetworkAdapterProfile
[-VMMServer <ServerConnection>]
[-SetAsVirtualNetworkAdapter]
[-SetAsManagementNIC]
-TransientManagementNetworkAdapter <PhysicalComputerNetworkAdapterProfile>
[-UseDhcpForIPConfiguration]
-LogicalSwitch <LogicalSwitch>
[-PortClassification <PortClassification>]
-VMNetwork <VMNetwork>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
Description
New-SCVMHostNetworkAdapterProfile Cmdlet 會建立網路介面卡設定檔。
請注意,建立網路介面卡設定檔之後,就無法更新它。 若要變更網路介面卡設定檔,您必須移除網路介面卡設定檔,然後重新建立它。
範例
範例 1:使用 DHCP 建立一般實體主機網路介面卡設定檔
PS C:\> New-SCVMHostNetworkAdapterProfile -SetAsPhysicalNetworkAdapter -SetAsGenericNIC -UseDhcpForIPConfiguration -ConsistentDeviceName "Physical host network adapter profile 01"
此命令會建立實體主機網路介面卡設定檔。
此命令中使用的交換器表示這是實體網路介面卡,而且網路介面卡不是主機的管理網路介面卡。 此外,DHCP 可用來取得網路介面卡的 IP 位址。
範例 2:使用邏輯交換器建立實體網路介面卡設定檔
PS C:\> $LogSwitch = Get-SCLogicalSwitch -Name "LogicalSwitch01"
PS C:\> $UplinkPortProfSet = Get-SCUplinkPortProfileSet -Name "UplinkPortProfileSet01"
PS C:\> New-SCVMHostNetworkAdapterProfile -SetAsPhysicalNetworkAdapter -LogicalSwitch $LogSwitch -UplinkPortProfileSet $UplinkPortProfSet -ConsistentDeviceName "Physical host network adapter profile 02"
第一個命令會取得名為 LogicalSwitch01 的邏輯交換器物件,並將物件儲存在$LogSwitch變數中。
第二個命令會取得名為 UplinkPortProfileSet01 的上行通訊埠設定檔集物件,並將物件儲存在 $UplinkPortProfSet 變數中。
最後一個命令會使用 LogicalSwitch01 和 UplinkPortProfileSet01 建立實體主機網路介面卡設定檔。
範例 3:使用靜態 IP 位址建立管理虛擬主機網路介面卡設定檔
PS C:\> $TransMgmtNIC = Get-SCVMHostNetworkAdapterProfile -ID "259f47c7-c5a9-429d-a421-d232f9b34991"
PS C:\> $LogSwitch = Get-SCLogicalSwitch -Name "LogicalSwitch01"
PS C:\> $VMNetwork = Get-SCVMNetwork -Name "VMNetwork01"
PS C:\> New-SCVMHostNetworkAdapterProfile -SetAsVirtualNetworkAdapter -SetAsManagementNIC -TransientManagementNetworkAdapter $TransMgmtNIC -UseStaticIPForIPConfiguration -LogicalSwitch $LogSwitch -VMNetwork $VMNetwork
第一個命令會取得識別碼為 259f47c7-c5a9-429d-a421-d232f9b34991 的主網路介面卡設定檔物件,並將物件儲存在$TransMgmtNIC變數中。
第二個命令會取得名為 LogicalSwitch01 的邏輯交換器物件,並將物件儲存在$LogSwitch變數中。
第三個命令會取得名為 VMNetwork01 的 VM 網路物件,並將物件儲存在$VMNetwork變數中。
最後一個命令會使用 LogicalSwitch01 和 VMNetwork01,建立虛擬主機網路介面卡 prfile 作為管理網路介面卡。
參數
-ConsistentDeviceName
指定網路介面卡的一致裝置名稱。
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 |
-PortClassification
指定虛擬網路介面卡所連線之交換器的埠分類。
Type: | PortClassification |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PROTipID
指定觸發此動作 (PRO 提示) 效能和資源優化提示的識別碼。 此參數可讓您稽核 PRO 秘訣。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsynchronously
表示作業會以非同步方式執行,讓控制項立即返回命令殼層。
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: | PhysicalComputerNetworkAdapterProfile |
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 |
輸出
HostNetworkAdapterProfile
此 Cmdlet 會傳回 HostNetworkAdapterProfile 物件。