< Back

Stop-AzureRmRecoveryServicesBackupJob

Tue Jan 29, 2019 10:00 pm

NAME Stop-AzureRmRecoveryServicesBackupJob



SYNOPSIS

Cancels a running job.





SYNTAX

Stop-AzureRmRecoveryServicesBackupJob [-Job] <JobBase> [-DefaultProfile <IAzureContextContainer>] [-Confirm] [-WhatIf] [<CommonParameters>]



Stop-AzureRmRecoveryServicesBackupJob [-JobId] <String> [-DefaultProfile <IAzureContextContainer>] [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

The Stop-AzureRmRecoveryServicesBackupJob cmdlet cancels an existing Azure Backup job. Use this cmdlet to stop a job that takes too long and

blocks other activities.



You can cancel only Backup and Restore job types.



Set the vault context by using the Set-AzureRmRecoveryServicesVaultContext cmdlet before you use the current cmdlet.





PARAMETERS

-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Job <JobBase>

Specifies a job that this cmdlet cancels. To obtain a BackupJob object, use the Get-AzureRmRecoveryServicesBackupJob cmdlet.



Required? true

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-JobId <String>

Specifies the ID of the job to cancel. The ID is the InstanceId property of a BackupJob object. To obtain an BackupJob object, use

Get-AzureRmRecoveryServicesBackupJob.



Required? true

Position? 2

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

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, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.JobBase







NOTES









Example 1: Stop a backup job



PS C:\\>$Job = Get-AzureRmRecoveryServicesBackupJob -Operation Backup

PS C:\\> Stop-AzureRmRecoveryServicesBackupJob -JobID $Job.InstanceId



The first command gets a backup job, and then stores the job in the $Job variable.



The last command stops the job by specifying the Instance ID of the backup job in $Job.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... sbackupjob

Get-AzureRmRecoveryServicesBackupJobDetails

Wait-AzureRmRecoveryServicesBackupJob