Get-AzureRmRecoveryServicesAsrJob
Gets the details of the specified ASR job or the list of recent ASR jobs in the Recovery Services vault.
Warning
The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.
Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.
Syntax
Get-AzureRmRecoveryServicesAsrJob
[-StartTime <DateTime>]
[-EndTime <DateTime>]
[-TargetObjectId <String>]
[-State <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzureRmRecoveryServicesAsrJob
-Name <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzureRmRecoveryServicesAsrJob
-Job <ASRJob>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Get-AzureRmRecoveryServicesAsrJob cmdlet gets Azure Site Recovery jobs. You can use this cmdlet to view the ASR jobs in the Recovery Services vault.
Examples
Example 1
PS C:\> $jobs = Get-AzureRmRecoveryServicesAsrJob -TargetObjectId $ASRObjectId
Returns all the jobs on a particular ASR object(reference the ASR object such as replicated item or recovery plan by its ID.)
Parameters
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Type: | IAzureContextContainer |
Aliases: | AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EndTime
Specifies the end time for the jobs.
This cmdlet gets all jobs that started before the specified time.
To obtain a DateTime object for this parameter, use the Get-Date cmdlet.
For more information, type Get-Help Get-Date
.
Type: | Nullable<T>[DateTime] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Job
Specifies the ASR job object to get updated details for.
Type: | ASRJob |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Specify the ASR job by name.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
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: | Nullable<T>[DateTime] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-State
Specifies the state for a ASR 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 |
Accepted values: | NotStarted, InProgress, Succeeded, Other, Failed, Cancelled, Suspended |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TargetObjectId
Specifies the ID of the object. Used to search for jobs on the specified object.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Outputs
IEnumerable<T>[[Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.ASRJob, Microsoft.Azure.Commands.RecoveryServices.SiteRecovery, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null]]