共用方式為


Get-AzureSiteRecoveryJob

取得 Site Recovery 保存庫的作業資訊。

注意

本文件中參考的 Cmdlet 用於管理使用 Azure Service Manager(ASM) API 的舊版 Azure 資源。 建立新的資源時,不建議使用此舊版 PowerShell 模組,因為 ASM 已排定淘汰。 如需詳細資訊,請參閱 Azure Service Manager 淘汰

Az PowerShell 模組是使用 PowerShell 管理 Azure Resource Manager (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>]

Description

Get-AzureSiteRecoveryJob Cmdlet 會取得 Azure Site Recovery 作業。 您可以使用此 Cmdlet 來檢視目前 Site Recovery 保存庫的作業資訊。

範例

範例 1:藉由指定標識碼來取得作業

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           : {}

此命令會取得具有指定標識碼的 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

指定要取得之作業的識別碼。

類型: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 會取得符合指定狀態的所有作業。 此參數可接受的值為:

  • 未開始
  • 進行中
  • 成功
  • 其他
  • 失敗
  • 已取消
  • 暫止
類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-TargetObjectId

指定作業目標物件的識別碼。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False