Find-SCJob

Find-SCJob

Searches for VMM jobs.

構文

Parameter Set: FindAfter
Find-SCJob -MaxCount <Int32> [-After <DateTime> ] [-CriticalFailures <Boolean> ] [-ObjectID <Guid> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: FindRecent
Find-SCJob -MaxCount <Int32> -Recent [-CriticalFailures <Boolean> ] [-ObjectID <Guid> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

詳細説明

The Find-SCJob cmdlet searches for Virtual Machine Manager (VMM) jobs. You can search for the most recent jobs, jobs after a certain date, or search for a job by its result or target ID.

パラメーター

-After<DateTime>

Specifies a DateTime object for the time after which jobs are retrieved. By default, time is represented in the local time zone. You can pass the DateTime object as UTC for standardized time.

When you specify this parameter, jobs are filtered by the StartTime property and returned from earliest start time to latest start time.

For information about getting a DateTime object, see the Get-Date cmdlet.

エイリアス

none

必須?

false

位置は?

named

既定値

none

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

false

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

false

-CriticalFailures<Boolean>

エイリアス

none

必須?

false

位置は?

named

既定値

none

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

false

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

false

-MaxCount<Int32>

Specifies the maximum number of jobs to return.

エイリアス

none

必須?

true

位置は?

named

既定値

none

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

false

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

false

-ObjectID<Guid>

Specifies the object ID, as a GUID, for a service. This ID is the result object or target object for the returned job.

エイリアス

none

必須?

false

位置は?

named

既定値

none

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

false

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

false

-Recent

Indicates that the most recent jobs are returned. Jobs are returned from latest start time to earliest start time.

Use this parameter with MaxCount to retrieve only a specified number of jobs.

エイリアス

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: Find all jobs for the last five hours

This command searches for all jobs that started within the last five hours. Because the MaxCount parameter has a value of 25, only 25 job objects are displayed.

PS C:\> $StartTime = (Get-Date) - (New-TimeSpan -Hours 5)
PS C:\> Find-SCJob -MaxCount 25 -After $StartTime

Example 2: Find recent jobs

This command searches for recent jobs and displays the 50 most recent jobs.

PS C:\> Find-SCJob -MaxCount 50 -Recent

Example Example 3: Find jobs by ObjectID.

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

The second command returns up to 10 jobs for the specified virtual machine ID.

PS C:\> $VM = Get-SCVirtualMachine -Name "VM01"
PS C:\> Find-SCJob -MaxCount 10 -ObjectID $VM.Id

関連トピック

Get-SCJob

Restart-SCJob

Stop-SCJob

Get-SCVirtualMachine