Get-SCJob

Gets VMM job objects.

Description

The Get-SCJob cmdlet gets one or more System Center Virtual Machine Manager (VMM) job objects on the VMM server. A job is a series of steps that are performed sequentially to complete an action in the VMM environment. You can retrieve job objects based on specified criteria. 

In VMM, you can group a series of jobs and run them together as a set. For example, a complex action in VMM, such as creating a template, might incorporate a series of jobs, known as a job group. For examples that show you how to use job groups, see the following cmdlets: New-SCVMTemplate, New-SCHardwareProfile, New-SCVirtualDiskDrive, New-SCVirtualDVDDrive, New-SCVirtualMachine, and Set-SCVirtualCOMPort.

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

Parameters

Name

Required? false
Accept Pipeline Input? false
Position? 0
Specifies the name of a VMM object.

All

Required? false
Accept Pipeline Input? false
Position? named
Retrieves a full list of all subordinate objects independent of the parent object. For example, the command Get-SCVirtualDiskDrive -All retrieves all virtual disk drive objects regardless of the virtual machine object or template object that each virtual disk drive object is associated with.

Full

Required? false
Accept Pipeline Input? false
Position? named
Specifies that the cmdlet returns the job object with an audit record.

ID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the numerical identifier (as a globally unique identifier, or GUID) for a specific object.

Job

Required? false
Accept Pipeline Input? false
Position? named
Specifies a VMM job object.

VMMServer

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM server object.

Name

Required? false
Accept Pipeline Input? false
Position? 0
Specifies the name of a VMM object.

Full

Required? false
Accept Pipeline Input? false
Position? named
Specifies that the cmdlet returns the job object with an audit record.

ID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the numerical identifier (as a globally unique identifier, or GUID) for a specific object.

Job

Required? false
Accept Pipeline Input? false
Position? named
Specifies a VMM job object.

Newest

Required? false
Accept Pipeline Input? false
Position? named
Returns all jobs created in the last specified number of hours, or returns the specified number of most recent software updates.

Example format to return all jobs created in the last 48 hours: Get-SCJob -Newest 48
Example format to return the 10 newest updates: Get-SCUpdate -Newest 10

VMMServer

Required? false
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM server object.

Examples

1: Get all jobs currently running on a VMM server.
PS C:\> $VMMJobs = Get-SCJob | where { $_.Status -eq "Running" } | Format-List -Property Name, ID, Status
PS C:\> $VMMJobs
The first command gets all job objects from the VMM database, selects only those jobs that are currently in a Running staate, passes each object to the Format-List cmdlet which stores the name, ID, and Status in the $VMMJobs variable.

The second command displays the information stored in $VMMJobs to the user (in this case, that is the name, ID and Status of each running job).
2: Get information about the .NET type, methods, and properties of VMM job objects.
PS C:> Get-SCJob | Get-Member
This command uses the Get-Member cmdlet to display the .NET type, properties, methods, and events for Get-SCJob.

See Also