Get-AzureSiteRecoveryJob
Gets the operation information for a Site Recovery vault.
Note
The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.
The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.
Syntax
Get-AzureSiteRecoveryJob
[-StartTime <DateTime>]
[-EndTime <DateTime>]
[-TargetObjectId <String>]
[-State <String>]
[-Profile <AzureSMProfile>]
[<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 : 00001111-aaaa-2222-bbbb-3333cccc4444
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 : 00001111-aaaa-2222-bbbb-3333cccc4444
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.
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 |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Id
Specifies the ID of a job to get.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Job
Specifies a job to get.
Type: | ASRJob |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
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 |
Required: | False |
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 |
Required: | False |
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 |
Required: | False |
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 |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |