Set-PolicySchedule

Set-PolicySchedule

Sets the schedule for various protection jobs like synchronization, recovery point creation (shadow copy), and tape backups.

Syntax

Set-PolicySchedule [-OffsetInMinutes] <Int32> [-ProtectionGroup] <ProtectionGroup> [-PassThru <SwitchParameter>] [<CommonParameters>]


Set-PolicySchedule [-Schedule] <Schedule> [-ProtectionGroup] <ProtectionGroup> [-PassThru <SwitchParameter>] [<CommonParameters>]


Set-PolicySchedule [-JobType] <JobTypeType> [-ProtectionGroup] <ProtectionGroup> [-PassThru <SwitchParameter>] [-Remove] [<CommonParameters>]

Detailed Description

The Set-PolicySchedule cmdlet sets the schedule for various protection jobs like synchronization, recovery point creation (shadow copy), and tape backups.

Default schedules are set automatically when you specify the protection objective using Set-PolicyObjective.

To modify the default schedules use a Get-PolicySchedule followed by Set-PolicySchedule.

The various schedules that can be set are:

For Express full & SC schedule
[-TimesOfDay] <TimesOfDay> [-DaysOfWeek]<DaysOfWeek>
Ex: 6:00 AM, 12:00 AM We,Th

For Monthly/HalfYearly/Yearly ArchiveSchedules
[-StartTime] <StartTime> [-RelativeInterval <RelativeInterval>] [-DayOfWeek <DayOfWeek>]

Ex: -StartTime 1/1/2003 6:00 AM -RelativeInterval First -DayOfWeek Sa

For Daily Archive schedule
[-TimeOfDay] <TimeOfDay>

Ex: -StartTime 6:00 AM

For Quarterly Archive schedule
[-StartTime] <StartTime>
-StartTime 1/1/2003 6:00 AM

The frequency is determined by the input schedule.

Parameters

-JobType

Indicates the type of job for which options are being set. The possible value that this parameter can take is ConsistencyCheck.

Attributes

Name Value

Required?

true

Accept wildcard characters?

false

Accept Pipeline Input?

false

Position?

1

-OffsetInMinutes

The time in minutes by which you want to offset the start time of a job.

Attributes

Name Value

Required?

true

Accept wildcard characters?

false

Accept Pipeline Input?

false

Position?

1

-Schedule

A schedule describes the recurrence of the backup job. There is one schedule per job type which DPM triggers. Default schedules are generated by the Set-PolicyObjective cmdlet. To customize the schedule, use Get-PolicySchedule and pass the schedule to Set-PolicySchedule, specifying the backup recurrence.

Attributes

Name Value

Required?

true

Accept wildcard characters?

false

Accept Pipeline Input?

false

Position?

1

-ProtectionGroup

The name of a protection group.

Attributes

Name Value

Required?

true

Accept wildcard characters?

false

Accept Pipeline Input?

true (ByValue)

Position?

0

-PassThru

The -PassThru parameter can be used with many commands in DPM to return a related object in cases where there is no default output. Using the PassThru parameter allows such cmdlets to be part of a pipeline.

Attributes

Name Value

Required?

false

Accept wildcard characters?

false

Accept Pipeline Input?

false

Position?

named

-Remove

Indicates that a remove operation will be performed.

Attributes

Name Value

Required?

false

Accept wildcard characters?

false

Accept Pipeline Input?

false

Position?

named

-CommonParameter

This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, and OutVariable. For more information, see about_CommonParameters.

Input and Return Types

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

Notes

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

    Additionally, any updated information about the cmdlet will be available at https://go.microsoft.com/fwlink/?LinkId=95130.

Examples

EXAMPLE 1

$pg = Get-ProtectionGroup -DPMServerName TestingServer 
$ShadowCopysch = Get-PolicySchedule $pg -ShortTerm 
Set-PolicySchedule $pg $ShadowCopysch -DaysOfWeek mo -TimesOfDay 02:00

Sets the synchronization schedule for a protection group to be carried out on every Monday at 2 a.m.

EXAMPLE 2

$pg = Get-ProtectionGroup -dpmservername contoso 
$SC = Get-PolicySchedule $pg[1] -longterm 
$mpg = Get-ModifiableProtectionGroup -protectiongroup $pg[1] 
Set-PolicySchedule $mpg -Schedule $sc[2] -TimeOfDay "07:00 PM" 
Set-ProtectionGroup $mpg

Changes the synchronization schedule of a protection group.

Example 3

$pg = Get-ProtectionGroup Contoso
$mpg = Get-ModifiableProtectionGroup -ProtectionGroup $pg
Set-PolicySchedule $mpg -JobType CheckDataIntegrity -DaysOfWeek mo -TimesOfDay 18:00
Set-ProtectionGroup $mpg

Allows you to schedule an integrity check on the Contoso DPM server to run every Monday at 6 P.M.