Поделиться через


Set-DPMPolicySchedule

Set-DPMPolicySchedule

Sets the schedule for protection jobs.

Syntax

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>]

Detailed Description

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-DPMPolicyObjective cmdlet. To change the default schedules, run the Get-DPMPolicySchedule cmdlet followed by the Set-DPMPolicySchedule cmdlet.

This cmdlet includes the following dynamic parameters that you can use to define schedules:

For express full and shadow copy schedule, specify the following parameters, as in the following examples:

[-TimesOfDay] <TimesOfDay> [-DaysOfWeek]<DaysOfWeek>
-TimesOfDay "6:00 AM"
-TimesOfDay "12:00 AM" -DaysOfWeek We,Th

For monthly, half-yearly, and yearly archive schedules, specify the following parameters, as in the following example:

[-StartTime] <StartTime> [-RelativeInterval <RelativeInterval>] [-DaysOfWeek <DaysOfWeek>]
-StartTime "1/1/2003 6:00 AM" -RelativeInterval First -DaysOfWeek Sa

For daily archive schedule, specify the following parameter, as in the following example:

[-TimeOfDay] <TimeOfDay>
-StartTime "6:00 AM"

For quarterly archive schedule, specify the following parameter, as in the following example:

[-StartTime] <StartTime>
-StartTime "1/1/2003 6:00 AM"

Parameters

-JobType<SetPolicyScheduleCmdlet+ProtectionJobType>

Indicates the type of job for which this cmdlet sets options. The only valid value for this parameter is ConsistencyCheck.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-OffsetInMinutes<Int32>

Specifies the time, in minutes, by which to offset the start time of a job.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PassThru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ProtectionGroup<ProtectionGroup>

Specifies a protection group object to which this schedule applies. To obtain a ProtectionGroup object, use the Get-DPMProtectionGroup cmdlet.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Remove

Indicates that the cmdlet removes a schedule for a protection operation.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

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-DPMPolicyObjective cmdlet.

Customize a default schedule by using Get-DPMPolicySchedule, and then pass the schedule to Set-DPMPolicySchedule.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • ProtectionGroup

Examples

Example 1: Create a synchronization schedule for a protection group

The first command gets the protection group from the DPM server named DPMServer02, and then stores the result in the $PGroup variable.

The second command gets the short-term schedule for performing integrity checks from the protection group in $PGroup, and then stores the result in the $ShadowCopysch variable.

The third command sets synchronization to run at 2:00 AM every Monday.

PS C:\> $PGroup = Get-DPMProtectionGroup -DPMServerName "DPMServer02"
PS C:\> $ShadowCopysch = Get-PolicySchedule $PGroup -ShortTerm
PS C:\> Set-DPMPolicySchedule -ProtectionGroup $PGroup -Schedule $ShadowCopysch -DaysOfWeek mo -TimesOfDay 02:00

Example 2: Change a synchronization schedule for a protection group

The first command gets protection groups from the DPM server named ContosoDPM1, and then stores them in the $PGroup variable.

The second command gets the long-term synchronization schedule for the second protection group in $PGroup, and then stores the result in the $Schedule variable.

The third command gets the second protection group in in $PGroup, and then stores the group in the $MPGroup variable. The command gets the protection group in editable format.

The fourth command sets the policy schedule for the third schedule in $Schedule to run at 7:00 PM daily.

The fifth command uses the Set-DPMProtectionGroup cmdlet to save your changes.

PS C:\> $PGroup = Get-DPMProtectionGroup -dpmservername "ContosoDPM1"
PS C:\> $Schedule = Get-DPMPolicySchedule $PGroup[1] -longterm
PS C:\> $MPGroup = Get-DPMModifiableProtectionGroup -ProtectionGroup $PGroup[1]
PS C:\> Set-DPMPolicySchedule -ProtectionGroup $MPGroup -Schedule $Schedule[2] -TimeOfDay "07:00 PM"
PS C:\> Set-DPMProtectionGroup -ProtectionGroup $MPGroup

Example 3: Schedule an integrity check for a DPM server

The first command gets the protection group from the DPM server named ContosoDPM1, and then stores it in the $PGroup variable.

The second command gets the protection group in $PGroup, and then stores it in the $MPGroup variable in editable format.

The third command schedules a data integrity check to run on the server every Monday at 6:00 PM.

The fourth command uses the Set-DPMProtectionGroup cmdlet save your changes.

PS C:\> $PGroup = Get-DPMProtectionGroup "ContosoDPM1"
PS C:\> $MPGroup = Get-DPMModifiableProtectionGroup -ProtectionGroup $PGroup
PS C:\> Set-DPMPolicySchedule -ProtectionGroup $MPGroup -JobType CheckDataIntegrity -DaysOfWeek mo -TimesOfDay 18:00
PS C:\> Set-DPMProtectionGroup -ProtectionGroup $MPGroup

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 $MPGroup, and then stores those schedules in the $OnlineSchedule 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:\> $PGroup = Get-ProtectionGroup -DPMServerName "DPMServer02"
PS C:\> $MPGroup = Get-ModifiableProtectionGroup -ProtectionGroup $PGroup[0]
PS C:\> Set-DPMPolicyObjective -ProtectionGroup $MPGroup -OnlineRetentionRangeList $RRList
PS C:\> $onlineSch = Get-DPMPolicySchedule -ProtectionGroup $MPGroup -LongTerm Online
PS C:\> Set-DPMPolicySchedule -ProtectionGroup $MPGroup -Schedule $nlineSchedule[0] -TimesOfDay 02:00
PS C:\> Set-DPMPolicySchedule -ProtectionGroup $MPGroup -Schedule $OnlineSchedule[1] -TimesOfDay 02:00 -DaysOfWeek Sa,Su -Interval 1
PS C:\> Set-DPMPolicySchedule -ProtectionGroup $MPGroup -Schedule $OnlineSchedule[2] -TimesOfDay 02:00 -RelativeIntervals First,Third -DaysOfWeek Sa
PS C:\> Set-DPMPolicySchedule -ProtectionGroup $MPGroup -Schedule $OnlineSchedule[3] -TimesOfDay 02:00 -DaysOfMonth 2,5,8,9 -Months Jan,Jul

Get-DPMPolicySchedule

Get-DPMPolicyObjective

Set-DPMPolicyObjective