Get-SCJob

Get-SCJob

Gets VMM job objects.

構文

Parameter Set: NewestJobs
Get-SCJob [[-Name] <String> ] [-Full] [-ID <Guid]> ] [-Job <Task> ] [-Newest <Int32> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: AllJobs
Get-SCJob [[-Name] <String> ] -All [-Full] [-ID <Guid]> ] [-Job <Task> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: RunningJobs
Get-SCJob [[-Name] <String> ] -Running [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

詳細説明

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.

パラメーター

-All

Indicates that this cmdlet 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.

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Full

Indicates that this cmdlet returns the job object with an audit record.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-ID<Guid]>

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

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Job<Task>

Specifies a VMM job object.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Name<String>

Specifies the name of a VMM object.

エイリアス

none

必須?

false

位置は?

1

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

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

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-OnBehalfOfUser<System.String>

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-OnBehalfOfUserRole<Microsoft.SystemCenter.VirtualMachineManager.UserRole>

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Running

Indicates that all running jobs are returned.

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-VMMServer<ServerConnection>

Specifies a VMM server object.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

  • Job

Example 1: Get all running jobs

This command retrieves all running jobs.

PS C:\> Get-Job -Running

Example 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. The command stores the name, ID, and Status in the $VMMJobs variable.

The second command displays the information stored in $VMMJobs. In this case, the command displays 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

Example Example 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 the job objects that Get-SCJob gets.

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

関連トピック

Find-SCJob

Get-SCStep

New-SCHardwareProfile

New-SCVirtualDiskDrive

New-SCVirtualDVDDrive

New-SCVirtualMachine

New-SCVMTemplate

Restart-SCJob

Set-SCVirtualCOMPort

Stop-SCJob