Stop-SCVirtualMachine

Stop-SCVirtualMachine

Stops virtual machines managed by VMM.

構文

Parameter Set: SingleVM
Stop-SCVirtualMachine [-VM] <VM> [-JobVariable <String> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-Shutdown] [ <CommonParameters>]

Parameter Set: CorrespondsToVMM2008DiscardSavedStateVM
Stop-SCVirtualMachine [-VM] <VM> -DiscardSavedState [-JobVariable <String> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [ <CommonParameters>]

Parameter Set: CorrespondsToVMM2008SaveStateVM
Stop-SCVirtualMachine [-VM] <VM> -SaveState [-JobVariable <String> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [ <CommonParameters>]

Parameter Set: CorrespondsToVMM2008StopVM
Stop-SCVirtualMachine [-VM] <VM> -Force [-JobVariable <String> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [ <CommonParameters>]

詳細説明

The Stop-SCVirtualMachine cmdlet stops one or more running virtual machines on hosts managed by Virtual Machine Manager (VMM) and returns the virtual machine object in a stopped state.

Stop-SCVirtualMachine stops a virtual machine in the same manner as shutting down the operating system on a computer. Stop-SCVirtualMachine with the Force parameter stops a virtual machine in the same manner as turning off a computer.

To resume running a stopped virtual machine, use the Start-SCVirtualMachine cmdlet.

パラメーター

-DiscardSavedState

Deletes the saved state associated with a virtual machine or service.

エイリアス

none

必須?

true

位置は?

named

既定値

none

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

false

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

false

-Force

Forces the operation to complete.

For example:

- Remove-SCSCVMHost -Force

Forces the removal of a host object from the VMM database.

- Stop-SCVirtualMachine -Force

Stops a virtual machine.

エイリアス

none

必須?

true

位置は?

named

既定値

none

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

false

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

false

-JobVariable<String>

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

エイリアス

none

必須?

false

位置は?

named

既定値

none

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

false

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

false

-OnBehalfOfUser<System.String>

エイリアス

none

必須?

false

位置は?

named

既定値

none

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

false

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

false

-OnBehalfOfUserRole<Microsoft.SystemCenter.VirtualMachineManager.UserRole>

エイリアス

none

必須?

false

位置は?

named

既定値

none

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

false

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

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

-SaveState

Saves the state of a virtual machine or service.

エイリアス

none

必須?

true

位置は?

named

既定値

none

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

false

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

false

-Shutdown

Indicates that a virtual machine, service, or a source server should be shut down. In the case of a virtual machine or service, the associated cmdlet attempts to use the operating system to shut the virtual machine down gracefully. In the case of a successful physical-to-virtual machine (P2V) conversion, the cmdlet shuts down the source server.

エイリアス

none

必須?

false

位置は?

named

既定値

none

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

false

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

false

-VM<VM>

Specifies a virtual machine object.

エイリアス

none

必須?

true

位置は?

1

既定値

none

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

True (ByValue)

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

false

<CommonParameters>

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

入力

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

出力

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

  • VirtualMachine

  • Requires a virtual machine object, which can be retrieved by using the Get-SCVirtualMachine cmdlet.

Example 1: Stop a specified virtual machine

The first command gets the virtual machine object named VM01, and then stores the object in the $VM variable. This example assumes that only one virtual machine named VM01 exists and that it is currently in a running state.

The second command stops the virtual machine stored in $VM and displays information about the stopped object.

PS C:\> $VM = Get-SCVirtualMachine -Name "VM01"
PS C:\> Stop-SCVirtualMachine -VM $VM

Example 2: Stop multiple virtual machines

The first command gets all virtual machine objects whose name contains the string VMM and whose current status is Running. The command then stores those objects in the $VMs variable.

The second command passes each virtual machine object stored in $VMs to Stop-SCVirtualMachine, which stops each virtual machine and displays information about the stopped virtual machines.

PS C:\> $VMs = Get-SCVirtualMachine | where { $_.Name -match "VM" -and $_.Status -eq "Running" }
PS C:\> $VMs | Stop-SCVirtualMachine

関連トピック

Get-SCVirtualMachine

Move-SCVirtualMachine

New-SCVirtualMachine

Read-SCVirtualMachine

Register-SCVirtualMachine

Remove-SCVirtualMachine

Repair-SCVirtualMachine

Reset-SCVirtualMachine

Resume-SCVirtualMachine

Set-SCVirtualMachine

Start-SCVirtualMachine

Suspend-SCVirtualMachine