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
ByParam (Default)
Get-AzureSiteRecoveryJob
[-StartTime <DateTime>]
[-EndTime <DateTime>]
[-TargetObjectId <String>]
[-State <String>]
[-Profile <AzureSMProfile>]
[<CommonParameters>]
ById
Get-AzureSiteRecoveryJob
-Id <String>
[-Profile <AzureSMProfile>]
[<CommonParameters>]
ByObject
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
.
Parameter properties
Type: | DateTime |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
ByParam
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Id
Specifies the ID of a job to get.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
ById
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Job
Specifies a job to get.
Parameter properties
Type: | ASRJob |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
ByObject
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | 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.
Parameter properties
Type: | AzureSMProfile |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-StartTime
Specifies the start time for the jobs. This cmdlet gets all jobs that started after the specified time.
Parameter properties
Type: | DateTime |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
ByParam
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | 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
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
ByParam
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-TargetObjectId
Specifies the ID of the object targeted by the job.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
ByParam
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.