Add-SCNetworkService
將網路服務新增至 VMM。
Syntax
Add-SCNetworkService
[-ProvisionSelfSignedCertificatesForNetworkService <Boolean>]
[-VMMServer <ServerConnection>]
[-ConnectionString] <String>
-Manufacturer <String>
-Model <String>
[-Version <String>]
-RunAsAccount <RunAsAccount>
-VMHostGroup <HostGroup[]>
-Name <String>
[-Description <String>]
[-BandwidthCapacityKBps <UInt64>]
[-Certificate <ClientCertificate[]>]
[-LogicalNetworkVIP <LogicalNetwork[]>]
[-LogicalNetworkDedicatedIP <LogicalNetwork[]>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
Add-SCNetworkService
[-ProvisionSelfSignedCertificatesForNetworkService <Boolean>]
[-VMMServer <ServerConnection>]
[-ConnectionString] <String>
[-Version <String>]
-RunAsAccount <RunAsAccount>
-VMHostGroup <HostGroup[]>
-Name <String>
[-Description <String>]
-ConfigurationProvider <ConfigurationProvider>
[-BandwidthCapacityKBps <UInt64>]
[-Certificate <ClientCertificate[]>]
[-LogicalNetworkVIP <LogicalNetwork[]>]
[-LogicalNetworkDedicatedIP <LogicalNetwork[]>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
Description
Add-SCNetworkService Cmdlet 會將網路服務新增至 Virtual Machine Manager (VMM) 。
範例
範例 1:將網路控制站的網路服務新增至 VMM
PS C:\> $RunAsAccount = Get-SCRunAsAccount -ID "dc90a558-c402-4a70-9f6b-e50bc2fad540"
PS C:\> $ConfigurationProvider = Get-SCConfigurationProvider -Name "Microsoft Network Controller"
PS C:\> $VmHostGroup = @()
PS C:\> $VmHostGroup += Get-SCVMHostGroup -Name "All Hosts"
PS C:\> $Certificates = @()
PS C:\> $Certificates += Get-SCCertificate -ComputerName "networkcontroller.contoso.com" -TCPPort 443
PS C:\> Add-SCNetworkService -Name "NetworkController" -RunAsAccount $runAsAccount -ConfigurationProvider $ConfigurationProvider -VMHostGroup $vmHostGroup -ConnectionString "serverUrl=https://networkcontroller.contoso.com;serviceName=NC_Service" -Certificate $Certificates -ProvisionSelfSignedCertificatesForNetworkService $True
第一個命令會取得 VMM 用來與網路服務通訊的執行身分帳戶。 命令會將它儲存在 $RunAsAccount 變數中。
第二個命令會取得網路控制站的組態提供者。
第三個命令會建立名為 $VmHostGroup 的陣列變數。 第四個命令會新增可存取網路服務的主機群組$VmHostGroup。
第五個命令會建立名為 $Certificates 的陣列變數。 第六個命令會將網路控制站可用的憑證新增至 $Certificates。
最後一個命令會將網路控制站的網路服務新增至 VMM。 命令會指定在先前命令中建立的值。 由於此範例會針對網路控制站使用自我簽署憑證, 所以 ProvisionSelfSignedCertificatesForNetworkService 的值為 $True。
參數
-BandwidthCapacityKBps
指定網路服務的頻寬容量,以每秒 KB 為單位 (KBps) 。
Type: | UInt64 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Certificate
指定安全性憑證物件的陣列。
Type: | ClientCertificate[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ConfigurationProvider
指定組態提供者物件。
組態提供者是 VMM 的外掛程式,可將 VMM PowerShell 命令轉譯為負載平衡器類型特定的 API 呼叫。 如果未指定任何組態提供者,VMM 會使用製造商和型號資訊來選擇可用的組態提供者。 如果找不到組態提供者,則不會新增負載平衡器。
Type: | ConfigurationProvider |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ConnectionString
指定連接到虛擬交換器擴充管理員所需的資訊。
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Description
指定網路服務的描述。
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 |
-LogicalNetworkDedicatedIP
指定邏輯網路物件的陣列。
Type: | LogicalNetwork[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LogicalNetworkVIP
指定邏輯網路物件的陣列。
Type: | LogicalNetwork[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Manufacturer
指定制造實體裝置的公司名稱。 此參數可接受的值為:
- a-z) (字母
- 數字 (0-9)
- 底線 (_)
- 連字號 (-)
- Dot (.)
- 單引號 (')
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Model
指定實體裝置的模型。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
指定網路物件的名稱。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
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 |
-ProvisionSelfSignedCertificatesForNetworkService
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsAccount
指定執行身分帳戶,其中包含具有執行此動作許可權的認證。
Type: | RunAsAccount |
Position: | Named |
Default value: | None |
Required: | True |
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 |
-Version
指定版本。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VMHostGroup
指定虛擬機器主機群組物件或主機群組物件的陣列。
Type: | HostGroup[] |
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 |