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


Set-DPMBackupWindow

Set-DPMBackupWindow

Sets the backup window settings for a protection group.

Syntax

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

Detailed Description

The Set-DPMBackupWindow cmdlet sets the backup window for a System Center 2012 – Data Protection Manager (DPM) protection group when you create or modify a protection group. The backup window of a protection group defines the time window during which scheduled backup 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 backup 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 backup 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 backup 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 backup 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 backup 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 the $PGroup in a modifiable form, and then stores it in the $MPGroup variable.

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

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

Example 2: Modify the backup 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 all schedules 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 stored 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 -ProtectionGroup $ProtectionGroup
PS C:\> $Schedule = Get-DPMPolicySchedule -PGroup $ModifiableProtectionGroup -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 -ProtectionGroup $ModifiableProtectionGroup

Example 3: Create a protection group and specify a backup window

This example creates a protection group, and configures its backup window. The ninth command sets the backup window that starts at 10 P.M. The window lasts 10 hours. The command specifies several days of the week in which the backup window falls. 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 $ProductionServer -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 $PGroup -DaysOfWeek @("Su", "Mo", "Tu", "Fr", "Sa") -StartTime 20:00 -DurationInHours 10
PS C:\> Set-DPMPolicySchedule -ProtectionGroup $PGroup -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-DPMBackupWindow

Get-DPMDatasource

Get-DPMPolicySchedule

Get-DPMProductionServer

Get-DPMProtectionGroup

New-DPMProtectionGroup

Set-DPMConsistencyCheckWindow

Set-DPMDatasourceDiskAllocation

Set-DPMDatasourceProtectionOption

Set-DPMPolicyObjective

Set-DPMPolicySchedule

Set-DPMProtectionGroup

Set-DPMProtectionJobStartTime

Set-DPMProtectionType

Set-DPMReplicaCreationMethod