Add-SilVMHost
Adds and updates host information in the Software Inventory Logging Aggregator database.
语法
Parameter Set: DataCenterName
Add-SilVMHost [[-VMHostName] <String[]> ] -HostCredential <PSCredential> [-Force] [-SCVMMTargetName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: VMHostName
Add-SilVMHost -HostCredential <PSCredential> -VMHostName <String[]> [-Force] [-HostType <String> ] [-HypervisorType <System.String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: VMWareTarget
Add-SilVMHost [[-VMHostName] <String[]> ] -HostCredential <PSCredential> [-Force] [-VMWareTargetName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
详细说明
The Add-SilVMHost cmdlet adds and updates host information in the Software Inventory Logging Aggregator database. This information includes fully qualified ___domain name (FQDN), hypervisor manufacturer, and credentials. When a host name already exists in the database, the cmdlet updates the host type and hypervisor for that host, and logs existing host names in Event Viewer.
This cmdlet can get the host information from a management server and store that information in the Software Inventory Logging Aggregator database. This cmdlet supports SCVMM and VMWare management servers.
参数
-Force
强制运行命令而不请求用户确认。
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-HostCredential<PSCredential>
Specifies the credentials that allow this cmdlet to connect to the host. To obtain a PSCredential object, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential
.
别名 |
none |
是否必需? |
true |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-HostType<String>
Specifies the type of the host. 此参数的可接受值是:
--Windows
-- VMware
-- Ubuntu
-- OpenSuse
-- Centos
-- Citrix
This cmdlet automatically detects host type, therefore, this parameter is not necessary.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-HypervisorType<System.String>
Specifies the type of the hypervisor. 此参数的可接受值是:
-- HyperV
-- Esxi
-- Xen
--XenServer
-- KVM
This cmdlet automatically detects hypervisor, therefore, this parameter is not necessary.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-SCVMMTargetName<String>
Specifies the name of an SCVMM management server.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-VMHostName<String[]>
Specifies an array of virtual machine host names to add or update.
别名 |
none |
是否必需? |
true |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
true(ByValue) |
是否接受通配符? |
false |
-VMWareTargetName<String>
Specifies the name of a VMWare management or vCenter server.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-Confirm
在运行 cmdlet 前提示你进行确认。
是否必需? |
false |
在哪里? |
named |
默认值 |
false |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-WhatIf
显示在 cmdlet 运行时将发生的情况。该 cmdlet 不运行。
是否必需? |
false |
在哪里? |
named |
默认值 |
false |
是否接受管道输入? |
false |
是否接受通配符? |
false |
<CommonParameters>
此 cmdlet 支持常见的参数:-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer 和 -OutVariable。有关详细信息,请参阅 TechNet 上的 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
输入
输入类型是可以传送到 cmdlet 的对象的类型。
输出
输出类型是 cmdlet 发出的对象的类型。
示例
Example 1: Add host names to the database with credentials
The first command creates a credential by using the Get-Credential cmdlet. That cmdlet prompts you for user name and password. The command stores those credentials in the $Credentials variable. For more information, type Get-Help Get-Credential
.
The second command identifies host type and hypervisor type. The command stores host names, host type, hypervisor type in the database. The command also updates host credentials in Credential Manager.
PS C:\> $Credential = Get-Credential
PS C:\> Add-SilVMHost -VMHostName "Host01","Host02","Host03" -HostCredential $Credential
Example 2: Get information for hosts managed by an SCVMM management server
This command gets the host information for hosts managed by an SCVMM management server. This command stores that host information in the database, and updates host credentials in Credential Manager.
PS C:\> Add-SilVMHost -HostCredential $Credential -SCVMMTargetName "ManagementServer.tsqa.contoso.com"
Example 3: Get information for hosts managed by a VMWare management server
This command gets the host information for hosts managed by a VMWare management or vCenter server. This command stores that host information in the database, and updates host credentials in Credential Manager.
PS C:\> Add-SilVMHost -HostCredential $Credential -VMWareTargetName "ManagementServer.tsqa.contoso.com"