Get-​Azure​Site​Recovery​Job

Gets the operation information for a Site Recovery vault.

Syntax

Get-AzureSiteRecoveryJob
   [-EndTime <DateTime>]
   [-Profile <AzureSMProfile>]
   [-StartTime <DateTime>]
   [-State <String>]
   [-TargetObjectId <String>]
   [<CommonParameters>]
Get-AzureSiteRecoveryJob
   -Id <String>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]
Get-AzureSiteRecoveryJob
   -Job <ASRJob>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]

Description

The Get-AzureSiteRecoveryJob cmdlet gets Azure Site Recovery jobs. You can use this cmdlet to view the operation information for the current Site Recovery vault.

Examples

Example 1: Get a job by specifying an ID

PS C:\> Get-AzureSiteRecoveryJob -Id "033785cc-9f72-4f07-8e78-e4d1e942a7ae" 
Name             : SaveRecoveryPlan
ID               : 033785cc-9f72-4f07-8e78-e4d1e942a7ae
ClientRequestId  : d604206b-32e1-4d5b-9a23-32b118d14a1e-2015-02-20 07:20:42Z-P
State            : Succeeded
StateDescription : Completed
StartTime        : 20-02-2015 07:20:45 +05:30
EndTime          : 20-02-2015 07:20:46 +05:30
TargetObjectId   : cfb445bf-fd14-4b5d-b9ac-5154e1415ef2
TargetObjectType : RecoveryPlan
TargetObjectName : RP
AllowedActions   : {Cancel}
Tasks            : {Save a recovery plan task}
Errors           : {}

This command gets the Azure Site Recovery job that has the specified ID.

Example 2: Gets a job based on time

PS C:\> Get-AzureSiteRecoveryJob -StartTime "20-02-2015 01:00:00" -EndTime "21-02-2015 01:00:00"
Name             : SaveRecoveryPlan
ID               : 033785cc-9f72-4f07-8e78-e4d1e942a7ae
ClientRequestId  : d604206b-32e1-4d5b-9a23-32b118d14a1e-2015-02-20 07:20:42Z-P
State            : Succeeded
StateDescription : Completed
StartTime        : 20-02-2015 07:20:45 +05:30
EndTime          : 20-02-2015 07:20:46 +05:30
TargetObjectId   : cfb445bf-fd14-4b5d-b9ac-5154e1415ef2
TargetObjectType : RecoveryPlan
TargetObjectName : RP
AllowedActions   : {Cancel}
Tasks            : {Save a recovery plan task}
Errors           : {}

This command gets Site Recovery jobs that fall between the specified start time and end time.

Required Parameters

-Id

Specifies the ID of a job to get.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Job

Specifies a job to get.

Type:ASRJob
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-EndTime

Specifies the end time for the jobs. This cmdlet gets all jobs that started before the specified time. To obtain a DateTime object, use the Get-Date cmdlet. For more information, type Get-Help Get-Date.

Type:DateTime
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Type:AzureSMProfile
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-StartTime

Specifies the start time for the jobs. This cmdlet gets all jobs that started after the specified time.

Type:DateTime
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-State

Specifies the input state for a Site Recovery job. This cmdlet gets all jobs that match the specified state. The acceptable values for this parameter are:

  • NotStarted
  • InProgress
  • Succeeded
  • Other
  • Failed
  • Cancelled
  • Suspended
Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TargetObjectId

Specifies the ID of the object targeted by the job.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False