Export (0) Print
Expand All
Expand Minimize

Get-SCJob

Updated: September 27, 2012

Applies To: System Center 2012 - Virtual Machine Manager

Get-SCJob

Gets VMM job objects.

Syntax

Parameter Set: NewestJobs
Get-SCJob [[-Name] <String> ] [-Full] [-ID <Guid> ] [-Job <Task> ] [-Newest <Int32> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: AllJobs
Get-SCJob [[-Name] <String> ] -All [-Full] [-ID <Guid> ] [-Job <Task> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]




Detailed 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

-All

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.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Full

Specifies that the cmdlet returns the job object with an audit record.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ID<Guid>

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


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Job<Task>

Specifies a VMM job object.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Name<String>

Specifies the name of a VMM object.


Aliases

none

Required?

false

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Newest<Int32>

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


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMMServer<ServerConnection>

Specifies a VMM server object.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Job

Examples

1: Get all jobs currently running on a VMM server.

The first command gets all job objects from the VMM database, selects only those jobs that are currently in a Running state, 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).


PS C:\> $VMMJobs = Get-SCJob | where { $_.Status -eq "Running" } | Format-List -Property Name, ID, StatusPS C:\> $VMMJobs

2: Get information about the .NET type, methods, and properties of VMM job objects.

This command uses the Get-Member cmdlet to display the .NET type, properties, methods, and events for Get-SCJob.


PS C:\> PS C:> Get-SCJob | Get-Member

Related topics

 
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft