Set-DPMPolicySchedule
Set-DPMPolicySchedule
Sets the schedule for protection jobs.
構文
Parameter Set: CheckDataIntegrity
Set-DPMPolicySchedule [-ProtectionGroup] <ProtectionGroup> [-JobType] <SetPolicyScheduleCmdlet+ProtectionJobType> {CheckDataIntegrity} [-PassThru] [-Remove] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: ModifySchedule
Set-DPMPolicySchedule [-ProtectionGroup] <ProtectionGroup> [-Schedule] <Schedule> [-PassThru] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: OffsetSchedule
Set-DPMPolicySchedule [-ProtectionGroup] <ProtectionGroup> [-OffsetInMinutes] <Int32> [-PassThru] [-Confirm] [-WhatIf] [ <CommonParameters>]
詳細説明
The Set-DPMPolicySchedule cmdlet sets the schedule for protection jobs in System Center 2012 – Data Protection Manager (DPM).
DPM sets default schedules automatically if you specify the protection objective by using the Set-PolicyObjective cmdlet. To change the default schedules, use the Get-PolicySchedule cmdlet followed by the Set-DPMPolicySchedule cmdlet.
You can set the following schedules.
For express full and shadow copy schedule:
[-TimesOfDay] <TimesOfDay> [-DaysOfWeek]<DaysOfWeek>
Example: 6:00 AM, 12:00 AM We,Th
For monthly, half-yearly, and yearly archive schedules:
[-StartTime] <StartTime> [-RelativeInterval <RelativeInterval>] [-DayOfWeek <DayOfWeek>]
Example: -StartTime 1/1/2003 6:00 AM -RelativeInterval First -DayOfWeek Sa
For daily archive schedule:
[-TimeOfDay] <TimeOfDay>
Example: -StartTime 6:00 AM
For quarterly archive schedule:
[-StartTime] <StartTime>
Example: -StartTime 1/1/2003 6:00 AM
The input schedule determines the frequency.
パラメーター
-JobType<SetPolicyScheduleCmdlet+ProtectionJobType>
Indicates the type of job for which you set options. This parameter can take the single value ConsistencyCheck.
エイリアス |
none |
必須? |
true |
位置は? |
2 |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-OffsetInMinutes<Int32>
Specifies the time, in minutes, by which to offset the start time of a job.
エイリアス |
none |
必須? |
true |
位置は? |
2 |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-PassThru
Indicates that the cmdlet generates output. By default, this cmdlet does not generate output. You can use the PassThru parameter in order to use the cmdlet in a pipeline.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-ProtectionGroup<ProtectionGroup>
Specifies a protection group object.
エイリアス |
none |
必須? |
true |
位置は? |
1 |
既定値 |
none |
パイプライン入力を許可する |
True (ByValue) |
ワイルドカード文字を許可する |
false |
-Remove
Indicates that the cmdlet removes a schedule for a protection operation.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-Schedule<Schedule>
Specifies a schedule object. A schedule describes the recurrence of a backup job. Each job type has one schedule, which DPM triggers. You create a default schedule by using the Set-PolicyObjective cmdlet.
Customize a default schedule by using the Get-PolicySchedule cmdlet and passing the schedule to Set-DPMPolicySchedule, specifying the backup recurrence.
エイリアス |
none |
必須? |
true |
位置は? |
2 |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-Confirm
コマンドレットを実行する前に、ユーザーに確認を求めます。
必須? |
false |
位置は? |
named |
既定値 |
false |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-WhatIf
コマンドレットを実行するとどのような結果になるかを表示します。コマンドレットは実行されません。
必須? |
false |
位置は? |
named |
既定値 |
false |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
<CommonParameters>
このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
出力
出力型は、コマンドレットによって生成されるオブジェクトの型です。
- ProtectionGroup
注
For more information, type "
Get-Help Get-PolicySchedule -detailed
".For technical information, type "
Get-Help Get-PolicySchedule -full
".
例
Example 1: Create a synchronization schedule for a protection group
This example creates a synchronization schedule for a protection group. DPM runs synchronization for the protection group every Monday at 2:00 A.M.
The first command gets the protection group from the DPM server named DPMServer02, and stores the result in the $Pg variable.
The second command gets the short-term schedule for performing integrity checks from the protection group stored in $Pg, and stores the result in the $ShadowCopysch variable.
The third command sets synchronization to run at 2:00 A.M. every Monday.
PS C:\> $Pg = Get-DPMProtectionGroup -DPMServerName "DPMServer02"
PS C:\> $ShadowCopysch = Get-PolicySchedule $Pg -ShortTerm
PS C:\> Set-DPMPolicySchedule $Pg $ShadowCopysch -DaysOfWeek mo -TimesOfDay 02:00
Example 2: Change a synchronization schedule for a protection group
This example changes a synchronization schedule for a protection group.
The first command gets protection groups from the DPM server named ContosoDPM1, and stores the result in the $Pg variable.
The second command gets the long-term synchronization schedule for the second protection group (at element 1) stored in $Pg, and stores the result in the $SC variable.
The third command gets the second protection group in editable form stored in $Pg, and stores the result in the $Mpg variable.
The fourth command sets the policy schedule for the third schedule (at element 2) stored in $SC to run at 7:00 P.M. daily.
The fifth command uses the Set-DPMProtectionGroup cmdlet to store the protection group that has the modified synchronization schedule.
PS C:\> $Pg = Get-DPMProtectionGroup -dpmservername "ContosoDPM1"
PS C:\> $SC = Get-DPMPolicySchedule $Pg[1] -longterm
PS C:\> $Mpg = Get-DPMModifiableProtectionGroup -ProtectionGroup $Pg[1]
PS C:\> Set-DPMPolicySchedule -ProtectionGroup $Mpg -Schedule $sc[2] -TimeOfDay "07:00 PM"
PS C:\> Set-DPMProtectionGroup -ProtectionGroup $Mpg
Example 3: Schedule an integrity check for a DPM server
This example creates a schedule for checking the integrity of a DPM server.
The first command gets the protection group from the DPM server named ContosoDPM1, and stores the result in the $Pg variable.
The second command gets the protection group in editable form stored in $Pg, and stores the result in the $Mpg variable.
The third command schedules a data integrity check to run on the server every Monday at 6:00 P.M.
The fourth command uses the Set-DPMProtectionGroup cmdlet to store the protection group that has the new integrity-check schedule.
PS C:\> $Pg = Get-DPMProtectionGroup "ContosoDPM1"
PS C:\> $Mpg = Get-DPMModifiableProtectionGroup -ProtectionGroup $Pg
PS C:\> Set-DPMPolicySchedule -ProtectionGroup $Mpg -JobType CheckDataIntegrity -DaysOfWeek mo -TimesOfDay 18:00
PS C:\> Set-DPMProtectionGroup -ProtectionGroup $Mpg
Example 4: Create online backup and retention schedules for a protection group
This example creates online backup and retention schedules for a protection group.
The first eight commands set the online policy objective for the protection group from the DPM server named DPMServer02. For more information, see the Set-DPMPolicyObjective cmdlet.
The ninth command gets the online schedules for the protection group stored in $Mpg, and then stores those schedules in the $onlineSch variable.
The tenth command updates daily backup/retention online schedule.
The eleventh command updates weekly retention online schedule.
The twelfth command updates monthly retention online schedule.
The thirteenth command updates yearly retention online schedule.
PS C:\> $RRlist = @()
PS C:\> $RRList += (New-Object -TypeName Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.OMCommon.RetentionRange -ArgumentList 18, Days)
PS C:\> $RRList += (New-Object -TypeName Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.OMCommon.RetentionRange -ArgumentList 10, Weeks)
PS C:\> $RRList += (New-Object -TypeName Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.OMCommon.RetentionRange -ArgumentList 6, Month)
PS C:\> $RRList += (New-Object -TypeName Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.OMCommon.RetentionRange -ArgumentList 5, Years)
PS C:\> $Pg = Get-ProtectionGroup -DPMServerName "DPMServer02"
PS C:\> $Mpg = Get-ModifiableProtectionGroup $Pg[0]
PS C:\> Set-DPMPolicyObjective -ProtectionGroup $Mpg -OnlineRetentionRangeList $RRList
PS C:\> $onlineSch=Get-DPMPolicySchedule -ProtectionGroup $mpg -LongTerm Online
PS C:\> Set-DPMPolicySchedule -ProtectionGroup $Mpg -Schedule $onlineSch[0] -TimesOfDay 02:00
PS C:\> Set-DPMPolicySchedule -ProtectionGroup $Mpg -Schedule $onlineSch[1] -TimesOfDay 02:00 -DaysOfWeek Sa,Su –Interval 1
PS C:\> Set-DPMPolicySchedule -ProtectionGroup $Mpg -Schedule $onlineSch[2] -TimesOfDay 02:00 -RelativeIntervals First,Third –DaysOfWeek Sa
PS C:\> Set-DPMPolicySchedule -ProtectionGroup $Mpg -Schedule $onlineSch[3] -TimesOfDay 02:00 -DaysOfMonth 2,5,8,9 -Months Jan,Jul