Get-SCJob
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>]
Parameter Set: RunningJobs
Get-SCJob [[-Name] <String> ] -Running [-VMMServer <ServerConnection> ] [ <CommonParameters>]
Detailed Description
The Get-SCJob cmdlet gets one or more 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.
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 |
-Running
Indicates that all running jobs are returned.
Aliases |
none |
Required? |
true |
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 (https://go.microsoft.com/fwlink/p/?LinkID=113216).
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 running jobs.
This command retrieves all running jobs.
PS C:\> PS C:> Get-Job -Running
2: Get all failed jobs.
The first command gets all job objects with a status of Failed, and then uses the pipeline operator to pass 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 "Failed" } | Format-List -Property Name, ID, Status
PS C:\> $VMMJobs
3: 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