Add-SCNetworkService
将网络服务添加到 VMM。
语法
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>]
说明
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
指定网络服务的带宽容量(以千字节/秒为单位) (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)
- 下划线 (_)
- 连字符 (-)
- 点 (.)
- 单引号 (')
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 提示) 的性能和资源优化提示的 ID。 此参数允许审核 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
指示作业异步运行,以便控件立即返回到命令 shell。
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 |