Stop-SCVirtualMachine

Stops virtual machines managed by VMM.

Description

The Stop-SCVirtualMachine cmdlet stops one or more running virtual machines on hosts managed by System Center 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.

For more information about Stop-SCVirtualMachine, type: "Get-Help Stop-SCVirtualMachine -online".

Parameters

VM

Required? true
Accept Pipeline Input? true (ByValue)
Position? 0
Specifies a virtual machine object.

DiscardSavedState

Required? false
Accept Pipeline Input? false
Position? named
Deletes the saved state associated with a virtual machine or service.

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

VM

Required? true
Accept Pipeline Input? true (ByValue)
Position? 0
Specifies a virtual machine object.

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

SaveState

Required? false
Accept Pipeline Input? false
Position? named
Saves the state of a virtual machine or service.

VM

Required? true
Accept Pipeline Input? true (ByValue)
Position? 0
Specifies a virtual machine object.

Force

Required? false
Accept Pipeline Input? false
Position? named
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.

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

VM

Required? true
Accept Pipeline Input? true (ByValue)
Position? 0
Specifies a virtual machine object.

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

VM

Required? true
Accept Pipeline Input? true (ByValue)
Position? 0
Specifies a virtual machine object.

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

Shutdown

Required? false
Accept Pipeline Input? false
Position? named
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.
Requires a virtual machine object, which can be retrieved by using the Get-SCVirtualMachine cmdlet.

Examples

1: Stop a specified virtual machine.
PS C:\> $VM = Get-SCVirtualMachine -Name "VM01"
PS C:\> Stop-SCVirtualMachine -VM $VM
The first command gets the virtual machine object named VM01 and 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 (in this case, VM01) and displays information about the stopped object to the user. 
2: Stop multiple virtual machines.
PS C:\> $VMs = Get-SCVirtualMachine | where { $_.Name -match "VM" -and $_.Status -eq "Running" }
PS C:\> $VMs | Stop-SCVirtualMachine
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-VM, which stops each virtual machine and displays information about the stopped virtual machines to the user.

See Also