Get-SCVMHost

Get-SCVMHost

Gets virtual machine host objects from the VMM database.

構文

Parameter Set: Connection
Get-SCVMHost [[-ComputerName] <String> ] [-ID <Guid]> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: VMHostCluster
Get-SCVMHost [[-ComputerName] <String> ] -VMHostCluster <HostCluster> [ <CommonParameters>]

Parameter Set: VMHostGroup
Get-SCVMHost [[-ComputerName] <String> ] -VMHostGroup <HostGroup> [ <CommonParameters>]

詳細説明

The Get-SCVMHost cmdlet gets one or more virtual machine host objects from the Virtual Machine Manager (VMM) database. Virtual machine hosts are physical computers that are managed by VMM on which you can deploy virtual machines.

VMM supports the following types of hosts:

-- Hyper-V
-- VMware ESX
-- Citrix XenServer

For more information about virtual machine hosts in VMM, type Get-Help Add-VMHost -detailed.

パラメーター

-ComputerName<String>

Specifies the name of a computer that VMM can uniquely identify on your network. Valid formats are:

-- FQDN
-- IPv4 or IPv6 address
-- NetBIOS name

NOTE: See the examples for a specific cmdlet to determine how that cmdlet specifies the computer name.

エイリアス

none

必須?

false

位置は?

1

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-ID<Guid]>

Specifies the numerical identifier as a globally unique identifier (GUID) for a specific object.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-VMHostCluster<HostCluster>

Specifies a VMM host cluster object.

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

false

-VMHostGroup<HostGroup>

Specifies a virtual machine host group object.

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

false

-VMMServer<ServerConnection>

Specifies a VMM server object.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

  • Host

Example 1: Get all hosts managed by the specified VMM server

This command gets all host objects for all managed by VMMServer01, and then displays the host properties to the user.

PS C:\> Get-SCVMHost -VMMServer "VMMServer01.Contoso.com"

Example 2: Get a host by name

This command gets the host object named VMHost01 in the Contoso.com domain, and then displays the host properties to the user.

PS C:\> Get-SCVMHost -ComputerName "VMHost01.Contoso.com"

Example 3: Get all hosts in a specific host group and display information about them to the user

The first command gets the host group object named HostGroup01 from VMMServer01, and then stores the object in the $HostGroup variable.

The second command gets all host objects in the host group stored in $HostGroup, and then stores the objects in the $HostsInHG variable.

The last command uses the pipeline operator to pass all host objects stored in $HostsInHG to the Format-Table cmdlet, which displays the name of each host and the virtual machines deployed on that host in a table.

PS C:\> $HostGroup = Get-SCVMHostGroup -Name "HostGroup01" -VMMServer "VMMServer01.Contoso.com"
PS C:\> $HostsInHG = Get-SCVMHost -VMHostGroup $HostGroup
PS C:\> $HostsInHG | Format-Table -Property Name, VMs

Example 4: Get all hosts in a specific host cluster and display information about them to the user

The first command gets the host cluster object named Cluster01 from VMMServer01, and then stores the object in the $Cluster variable.

The second command gets all host objects in Cluster01, and then stores the objects in the $HostsInCluster variable.

The last command passes all host objects stored in $HostsInCluster to the Format-Table cmdlet, which displays the name and virtualization platform of each host in Cluster01.

PS C:\> $Cluster = Get-SCVMHostCluster -Name "Cluster01.Contoso.com" -VMMServer "VMMServer01.Contoso.com"
PS C:\> $HostsInCluster = Get-SCVMHost -VMHostCluster $Cluster
PS C:\> $HostsInCluster | Format-Table -Property Name, VirtualizationPlatform

Example Example 5: Get a specific host located on a perimeter network by its IP address.

The first command gets the host object located on a perimeter network whose IP address is 10.199.53.5 from VMMServer01, and then stores the object in the $VMHost variable.

The second command uses the pipeline operator to pass the host object in $VMHost to the Select-Object cmdlet, which displays the computer name and operating system for the host.

PS C:\> $VMHost = Get-VMHost -ComputerName 10.199.53.5 -VMMServer "VMMServer01.Contoso.com"
PS C:\> $VMHost | Select-Object -Property ComputerName, OperatingSystem

関連トピック

Add-SCVMHost

Move-SCVMHost

Read-SCVMHost

Remove-SCVMHost

Set-SCVMHost

Get-SCVMHostGroup

Get-SCVMHostCluster