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


Set-DPMConsistencyCheckWindow

Set-DPMConsistencyCheckWindow

Sets the consistency check window for a protection group.

Syntax

Parameter Set: Default
Set-DPMConsistencyCheckWindow [-ProtectionGroup] <ProtectionGroup> [[-DaysOfWeek] {Su | Mo | Tu | We | Th | Fr | Sa}[] ] [-StartTime] <DateTime> [-DurationInHours] <Int32> [-PassThru] [ <CommonParameters>]

Detailed Description

The Set-DPMConsistencyCheckWindow cmdlet sets the consistency check window for a System Center 2012 – Data Protection Manager (DPM) protection group when you create or modify a protection group. The consistency check window of a protection group defines the time window during which scheduled consistency check jobs run.

This cmdlet works on modifiable protection groups.

Parameters

-DaysOfWeek<WeekDayType[]>

Specifies an array of days of the week. Valid values are:

-- Su
-- Mo
-- Tu
-- We
-- Th
-- Fr
-- Sa

The default value is all days.

Aliases

none

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DurationInHours<Int32>

Specifies the duration for which the consistency check window applies. The window applies from the value of the StartTime parameter. If the start time is 8 PM and the duration is 10 hours, the consistency check window for that day starts at 8 PM. The window finishes at 6 AM the next day.

Aliases

none

Required?

true

Position?

4

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 for which this cmdlet sets a window. 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

-StartTime<DateTime>

Specifies the time of the day when the consistency check window for that day starts.

Aliases

none

Required?

true

Position?

3

Default Value

none

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.

Examples

Example 1: Set a consistency check window

The first command gets protection groups on the DPM server named DPMServer02. This command passes the results to the Where-Object cmdlet. That cmdlet drops all groups except ones that match the specified friendly name. For more information, type Get-Help Where-Object. The command stores the protection group in the $PGroup variable.

The second command gets the protection group from $PGroup in a modifiable form, and then stores it in the $MPGroup variable.

The final command sets a consistency check window for the group stored in $MPGroup. The window lasts 12 hours. It starts at 4 PM. The command does not specify days on which consistency check windows occur. Therefore, they occur on every day.

PS C:\> $PGroup = Get-DPMProtectionGroup -DPMServerName "DPMServer02" | Where {$_.FriendlyName -like "*ContosoPG02*"}
PS C:\> $MPGroup = Get-DPMModifiableProtectionGroup $ProtectionGroup
PS C:\> Set-DPMConsistencyCheckWindow -ProtectionGroup $MPGroup -StartTime 16:00 -DurationInHours 12

Example 2: Modify the consistency check window of an existing group

This example modifies an existing protection group. It sets a backup window and consistency check window. For more information about this detailed example, see the related cmdlets that it includes.

The first command gets protection groups on the DPM server named DPMServer02. This command passes the results to the Where-Object cmdlet. The command stores the protection group in the $PGroup variable.

The second command gets the protection group from $PGroup in a modifiable form, and then stores it in the $MPGroup variable.

The third command gets the schedules for protection jobs, and then passes the results to Where-Object. That cmdlet drops schedules all except ones that match the specified job type. The command stores the schedules in the $Schedule variable.

The fourth command sets a backup window for the protection group in $MPGroup.

The fifth command sets a policy schedule for $MPGroup based on the value in $Schedule.

The sixth command sets the consistency check window for $MPGroup to start at midnight and last 24 hours.

The seventh command configures DPM consistency jobs to start at 2 AM and last up to three hours.

The final command saves all your changes to the protection group.

PS C:\> $PGroup = Get-DPMProtectionGroup -DPMServerName "DPMServer02" | Where {$_.FriendlyName -like "*ContosoPG02*"}
PS C:\> $MPGroup = Get-DPMModifiableProtectionGroup $PGroup
PS C:\> $Schedule = Get-DPMPolicySchedule -ProtectionGroup $MPGroup -ShortTerm | Where { $_.JobType -eq ""FullReplicationForApplication"" }
PS C:\> Set-DPMBackupWindow -ProtectionGroup $MPGroup -StartTime 16:00 -DurationInHours 12
PS C:\> Set-DPMPolicySchedule -ProtectionGroup $MPGroup -DaysOfWeek $Schedule.WeekDays -TimesOfDay $Schedule.TimesOfDay -Schedule $Schedule
PS C:\> Set-DPMConsistencyCheckWindow -ProtectionGroup $MPGroup -StartTime 00:00 -DurationInHours 24
PS C:\> Set-DPMProtectionJobStartTime -ProtectionGroup $MPGroup -JobType ConsistencyCheck -StartTime 02:00 -MaximumDurationInHours 3
PS C:\> Set-DPMProtectionGroup $MPGroup

Example 3: Create a protection group and specify a consistency check window

This example creates a protection group, and configures its consistency check window. The twelfth command sets the consistency check window that begins at 10 PM. The window lasts 12 hours. Because the command does not specify the DaysOfWeek parameter, the window applies every day. For more information about this detailed example, see the related cmdlets that it includes.

PS C:\> $PGroup = New-DPMProtectionGroup -DPMServerName "DPMServer02" -Name 'SQL protection group'
PS C:\> $PServer = Get-DPMProductionServer -DPMServerName "DPMCentral01"
PS C:\> $PObject = Get-DPMDatasource -ProductionServer $PServer -Inquire | Where {$_.DatasourceName -eq 'db1'}
PS C:\> Add-DPMChildDatasource -ProtectionGroup $PGroup -ChildDatasource $PObject
PS C:\> Set-DPMProtectionType -ProtectionGroup $PGroup -ShortTerm Disk
PS C:\> Set-DPMDatasourceDiskAllocation -Datasource $PObject -ProtectionGroup $PGroup
PS C:\> Set-DPMReplicaCreationMethod -ProtectionGroup $PGroup -Manual
PS C:\> $Schedule = Get-DPMPolicySchedule -ProtectionGroup $PGroup -ShortTerm | Where { $_.JobType -eq "FullReplicationForApplication" }
PS C:\> Set-DPMBackupWindow -ProtectionGroup $ProtectionGroup -DaysOfWeek @("Su", "Mo", "Tu", "Fr", "Sa") -StartTime 20:00 -DurationInHours 10
PS C:\> Set-DPMPolicySchedule -ProtectionGroup $ProtectionGroup -Schedule $sched -DaysOfWeek @("Su", "Mo", "Tu", "We", "Th", "Fr", "Sa") -TimesOfDay @('00:00', '04:00', '08:00', '12:00', '16:00', '20:00')
PS C:\> Set-DPMDatasourceProtectionOption -ProtectionGroup $PGroup -AutoConsistencyCheck $False
PS C:\> Set-DPMConsistencyCheckWindow -ProtectionGroup $PGroup -StartTime 22:00 -DurationInHours 12
PS C:\> Set-DPMProtectionJobStartTime -ProtectionGroup $PGroup -JobType ConsistencyCheck -StartTime 10:00 -MaximumDurationInHours 12
PS C:\> Set-DPMPolicyObjective -ProtectionGroup $PGroup -ColocateDatasources $False
PS C:\> Set-DPMProtectionGroup -ProtectionGroup $PGroup

Add-DPMChildDatasource

Get-DPMConsistencyCheckWindow

Get-DPMDatasource

Get-DPMModifiableProtectionGroup

Get-DPMPolicySchedule

Get-DPMProductionServer

Get-DPMProtectionGroup

New-DPMProtectionGroup

Set-DPMBackupWindow

Set-DPMDatasourceDiskAllocation

Set-DPMDatasourceProtectionOption

Set-DPMPolicyObjective

Set-DPMPolicySchedule

Set-DPMProtectionGroup

Set-DPMProtectionJobStartTime

Set-DPMProtectionType

Set-DPMReplicaCreationMethod