你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get-AzureSiteRecoveryJob
获取 Site Recovery 保管库的操作信息。
注意
本文档中引用的 cmdlet 用于管理使用 Azure Service Manager (ASM) API 的旧式 Azure 资源。 创建新资源时,建议不要使用旧的 PowerShell 模块,因为计划将停用 ASM。 有关详细信息,请参阅 Azure Service Manager 停用。
Az PowerShell 模块是建议用于管理 PowerShell 的 Azure 资源管理器 (ARM) 资源的 PowerShell 模块。
语法
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>]
说明
Get-AzureSiteRecoveryJob cmdlet 获取 Azure Site Recovery 作业。 可以使用此 cmdlet 查看当前 Site Recovery 保管库的操作信息。
示例
示例 1:通过指定 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 : {}
此命令获取具有指定 ID 的 Azure Site Recovery 作业。
示例 2:根据时间获取作业
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 : {}
此命令获取位于指定开始时间和结束时间之间的 Site Recovery 作业。
参数
-EndTime
指定作业的结束时间。
此 cmdlet 获取在指定时间之前启动的所有作业。
若要获取 DateTime 对象,请使用 Get-Date cmdlet。
要了解详情,请键入 Get-Help Get-Date
。
类型: | DateTime |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Id
指定要获取的作业的 ID。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Job
指定要获取的作业。
类型: | ASRJob |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Profile
指定此 cmdlet 从中读取的 Azure 配置文件。 如果未指定配置文件,此 cmdlet 将从本地默认配置文件中读取。
类型: | AzureSMProfile |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-StartTime
指定作业的开始时间。 此 cmdlet 获取指定时间后启动的所有作业。
类型: | DateTime |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-State
指定 Site Recovery 作业的输入状态。 此 cmdlet 获取与指定状态匹配的所有作业。 此参数的可接受值为:
- NotStarted
- 正在进行
- 已成功
- 其他
- 已失败
- 已取消
- 已挂起
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-TargetObjectId
指定作业所针对对象的 ID。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |