Add-SilVMHost

Add-SilVMHost

Adds and updates host information in the Software Inventory Logging Aggregator database.

Syntaxe

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>]

Description détaillée

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.

Paramètres

-Force

Force l'exécution de la commande sans demander une confirmation de l'utilisateur.

Alias

none

Requis ?

false

Position ?

named

Valeur par défaut

none

Accepter l'entrée de pipeline ?

false

Accepter les caractères génériques ?

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.

Alias

none

Requis ?

true

Position ?

named

Valeur par défaut

none

Accepter l'entrée de pipeline ?

false

Accepter les caractères génériques ?

false

-HostType<String>

Specifies the type of the host. Les valeurs acceptables pour ce paramètre sont les suivantes : 

--Windows
-- VMware
-- Ubuntu
-- OpenSuse
-- Centos
-- Citrix

This cmdlet automatically detects host type, therefore, this parameter is not necessary.

Alias

none

Requis ?

false

Position ?

named

Valeur par défaut

none

Accepter l'entrée de pipeline ?

false

Accepter les caractères génériques ?

false

-HypervisorType<System.String>

Specifies the type of the hypervisor. Les valeurs acceptables pour ce paramètre sont les suivantes : 

-- HyperV
-- Esxi
-- Xen
--XenServer
-- KVM

This cmdlet automatically detects hypervisor, therefore, this parameter is not necessary.

Alias

none

Requis ?

false

Position ?

named

Valeur par défaut

none

Accepter l'entrée de pipeline ?

false

Accepter les caractères génériques ?

false

-SCVMMTargetName<String>

Specifies the name of an SCVMM management server.

Alias

none

Requis ?

false

Position ?

named

Valeur par défaut

none

Accepter l'entrée de pipeline ?

false

Accepter les caractères génériques ?

false

-VMHostName<String[]>

Specifies an array of virtual machine host names to add or update.

Alias

none

Requis ?

true

Position ?

named

Valeur par défaut

none

Accepter l'entrée de pipeline ?

true(ByValue)

Accepter les caractères génériques ?

false

-VMWareTargetName<String>

Specifies the name of a VMWare management or vCenter server.

Alias

none

Requis ?

false

Position ?

named

Valeur par défaut

none

Accepter l'entrée de pipeline ?

false

Accepter les caractères génériques ?

false

-Confirm

Vous invite à confirmer l'exécution de l'applet de commande.

Requis ?

false

Position ?

named

Valeur par défaut

false

Accepter l'entrée de pipeline ?

false

Accepter les caractères génériques ?

false

-WhatIf

Indique ce qui se produit en cas d'exécution de l'applet de commande. L'applet de commande n'est pas exécutée.

Requis ?

false

Position ?

named

Valeur par défaut

false

Accepter l'entrée de pipeline ?

false

Accepter les caractères génériques ?

false

<CommonParameters>

Cette applet de commande prend en charge les paramètres courants : -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer et -OutVariable. Pour plus d'informations, consultez  . about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Entrées

Le type d'entrée correspond au type des objets que vous pouvez adresser à l'applet de commande.

Sorties

Le type de sortie correspond au type des objets que l'applet de commande émet.

Exemples

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"

Rubriques connexes

Get-SilVMHost

Remove-SilVMHost

Software Inventory Logging Cmdlets in Windows PowerShell