Delen via


Get-SCVMCheckpoint

Gets virtual machine checkpoint objects from the VMM database.

Syntax

Get-SCVMCheckpoint
   [-VMMServer <ServerConnection>]
   [-OnBehalfOfUser <String>]
   [-OnBehalfOfUserRole <UserRole>]
   [<CommonParameters>]
Get-SCVMCheckpoint
   [-VM <VM>]
   [-VMMServer <ServerConnection>]
   [-MostRecent]
   [-OnBehalfOfUser <String>]
   [-OnBehalfOfUserRole <UserRole>]
   [<CommonParameters>]
Get-SCVMCheckpoint
   [-VMMServer <ServerConnection>]
   [-ID <Guid>]
   [-OnBehalfOfUser <String>]
   [-OnBehalfOfUserRole <UserRole>]
   [<CommonParameters>]

Description

The Get-SCVMCheckpoint cmdlet gets one or more virtual machine checkpoint objects from the Virtual Machine Manager (VMM) database.

A virtual machine checkpoint is a point-in-time "snapshot" of a virtual machine. You can use the checkpoint to revert a virtual machine to a previous state. For more information about VMM checkpoints, type Get-Help New-VMCheckpoint -Detailed.

Examples

Example 1: Get all existing checkpoints for each virtual machine

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

This command gets all existing checkpoint objects for each virtual machine managed by VMMServer01 and displays information about these checkpoint objects to the user.

Example 2: Get all checkpoints for one or more virtual machines with a specific name

PS C:\> $Checkpoints = Get-SCVMCheckpoint -VM "VM01" 
PS C:\> $Checkpoints

The first command gets all checkpoint objects for virtual machine VM01 and stores the objects in the $Checkpoints object array.

The second command displays information about the checkpoint objects in $Checkpoints.

Example 3: Get the hardware profile of the most recently created checkpoint on a VM deployed on a Hyper-V host

PS C:\> $VM = Get-SCVirtualMachine -Name "VM01"
PS C:\> $Checkpoint = $VM | Get-SCVMCheckpoint -MostRecent
PS C:\> $Checkpoint.CheckpointHWProfile

The first command gets the virtual machine object named VM01 and stores the object in the $VM variable.

The second command gets the most recent checkpoint object created for VM01 and stores the object in the $Checkpoint variable.

The last command displays information about the hardware profile for checkpoint stored in $Checkpoint (the most recent checkpoint object created for VM01).

Example 4: Display the .NET type, events, methods, and properties for checkpoint objects

PS C:\> $Checkpoints = Get-SCVMCheckpoint -VMMServer "VMMServer01.Contoso.com"
PS C:\> $Checkpoints | Get-Member
PS C:\> $Checkpoints | Get-Member | Format-List

The first command gets all checkpoint objects on VMMServer01 and stores the objects in the $Checkpoints object array.

The second command passes each checkpoint object in $Checkpoints to the Get-Member cmdlet, which displays the .NET TypeName and the Name, MemberType, and Definition for each event, method, and property associated with this object type.

The last command is the same as the second command except that it pipes the output to the Format-List cmdlet so that you can see the complete definition for each event, method, and property for the checkpoint object type.

Parameters

-ID

Specifies the numerical identifier as a globally unique identifier, or GUID, for a specific object.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MostRecent

Specifies the most recent VMM virtual machine checkpoint object.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OnBehalfOfUser

Specifies the name of a user. This cmdlet sets the on behalf of user as the user that this parameter specifies.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OnBehalfOfUserRole

Specifies a user role. To obtain a user role, use the Get-SCUserRole cmdlet. This cmdlet operates on behalf of the user role that this parameter specifies.

Type:UserRole
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VM

Specifies a virtual machine object.

Type:VM
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Outputs

VMCheckpoint

This cmdlet returns a VMCheckpoint object.