共用方式為


Stop-DPMJob

Stop-DPMJob

Stops DPM jobs.

Syntax

Parameter Set: CancelDpmJob
Stop-DPMJob [-Job] <Job[]> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: CancelDpmTask
Stop-DPMJob [-Task] <Task[]> [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Stop-DPMJob cmdlet stops jobs that are running in System Center 2012 – Data Protection Manager (DPM).

Parameters

-Job<Job[]>

Specifies an array of jobs that this cmdlet stops. To obtain Job objects, use the Get-DPMJob cmdlet.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Task<Task[]>

Specifies an array of task objects.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

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.

Examples

Example 1: Stop all DPM jobs

The first command uses the Get-DPMProtectionGroup cmdlet to get the protection group for the server named Contoso-DPMServer. The command stores the group in the $PGroup variable.

The second command uses the Get-DPMJob cmdlet to get the jobs that are running for the protection group. The command stores the jobs in the $Jobs variable.

The third command stops the jobs stored in $Job.

PS C:\> $PGroup = Get-DPMProtectionGroup -DPMServerName "Contoso-DPMServer"
PS C:\> $Jobs = Get-DPMJob -ProtectionGroup $PGroup -Status InProgress
PS C:\> Stop-DPMJob -Job $Jobs

Get-DPMJob

Get-DPMProtectionGroup

Restart-DPMJob