Move-SCVMHost

Move-SCVMHost

Moves a virtual machine host managed by VMM from one host group to another.

構文

Parameter Set: Default
Move-SCVMHost [-VMHost] <Host> -ParentHostGroup <HostGroup> [-JobVariable <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [ <CommonParameters>]

詳細説明

The Move-SCVMHost cmdlet moves one or more virtual machine hosts managed by Virtual Machine Manager (VMM) from its current host group to a new parent host group. Before you can move a host, its new parent host group must exist.

If the host is a computer that is managed by members of a Self-Service User or Delegated Administrator user role, moving the host from one host group to another might affect the roles that have access to the host or to virtual machines on that host.

パラメーター

-JobVariable<String>

Specifies that job progress is tracked and stored in the variable named by this parameter.

エイリアス

none

必須?

false

位置は?

named

既定値

none

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

false

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

false

-ParentHostGroup<HostGroup>

Specifies the parent host group that contains one or more hosts, host groups, or host clusters.

エイリアス

ParentVMHostGroup

必須?

true

位置は?

named

既定値

none

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

True (ByValue)

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

false

-PROTipID<Guid]>

Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

エイリアス

none

必須?

false

位置は?

named

既定値

none

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

false

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

false

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

エイリアス

none

必須?

false

位置は?

named

既定値

none

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

false

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

false

-VMHost<Host>

Specifies a virtual machine host object. VMM supports Hyper-V hosts, VMware ESX hosts, and Citrix XenServer hosts.

For more information about each type of host, type Get-Help Add-SCVMHost -detailed. See the examples for a specific cmdlet to determine how that cmdlet uses this parameter.

エイリアス

none

必須?

true

位置は?

1

既定値

none

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

True (ByValue)

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

false

<CommonParameters>

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

入力

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

出力

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

  • Host

  • Requires a VMM host object, which can be retrieved by using the Get-SCVMHost cmdlet.

Example 1: Move a single host to a new parent host group

The first command gets the host named VMHost01, and then stores it in the $VMHost variable.

The second command gets the host group object named NewHostGroup, and then stores it in the $NewHG variable.

The last command moves the host stored in $VMHost to the host group stored in $NewHG.

PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01"
PS C:\> $NewHG = Get-SCVMHostGroup -Name "NewHostGroup01"
PS C:\> Move-SCVMHost -VMHost $VMHost -ParentHostGroup $NewHG

Example 2: Move all hosts to a new parent host group

The first command gets all host objects, and then stores them in the $AllHosts array.

The second command gets the host group named NewHostGroup02, and then stores it in the $NewHG variable.

The last command moves each host object in the $AllHosts array to the new parent host group stored in $NewHG.

PS C:\> $AllHosts = Get-SCVMHost
PS C:\> $NewHG = Get-SCVMHostGroup -Name "NewHostGroup02"
PS C:\> $AllHosts | Move-SCVMHost -ParentHostGroup $NewHG

Example Example 3: Move a set of hosts from one host group to a new parent host group.

The first command gets all host objects whose host group contains the string OldGroup, and then stores them in the $SpecificHosts variable.

The second command gets the host group named NewHostGroup03, and then stores it in the $NewHG variable.

The last command moves each host object stored in $SpecificHosts to the host group stored in $NewHG.

PS C:\> $SpecificHosts = Get-SCVMHost | where { $_.VMHostGroup -like "*OldGroup*" }
PS C:\> $NewHG = Get-SCVMHostGroup -Name "NewHostGroup03"
PS C:\> $SpecificHosts | Move-SCVMHost -ParentHostGroup $NewHG

関連トピック

Add-SCVMHost

Get-SCVMHost

Move-SCVMHostGroup

New-SCVMHostGroup

Read-SCVMHost

Remove-SCVMHost

Set-SCVMHost

Get-SCVMHostGroup