Set-DPMPolicySchedule

Set-DPMPolicySchedule

Sets the schedule for protection jobs.

Syntax

Parameter Set: CheckDataIntegrity
Set-DPMPolicySchedule [-ProtectionGroup] <ProtectionGroup> [-JobType] <ProtectionJobType> [-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-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.

Parameters

-JobType<ProtectionJobType>

Indicates the type of job for which you set options. This parameter can take the single value 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

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ProtectionGroup<ProtectionGroup>

Specifies a protection group object.

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

Customize a default schedule by using the Get-PolicySchedule cmdlet and passing the schedule to Set-DPMPolicySchedule, specifying the backup recurrence.

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

Notes

  • For more information, type "Get-Help Get-PolicySchedule -detailed".

    For technical information, type "Get-Help Get-PolicySchedule -full".

Examples

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

Get-DPMPolicySchedule

Get-DPMPolicyObjective

Set-DPMPolicyObjective