Set-DPMBackupWindow
Sets the backup window settings for a protection group.
Syntax
Set-DPMBackupWindow
[-ProtectionGroup] <ProtectionGroup>
[[-DaysOfWeek] <WeekDayType[]>]
[-StartTime] <DateTime>
[-DurationInHours] <Int32>
[-PassThru]
[<CommonParameters>]
Description
The Set-DPMBackupWindow cmdlet sets the backup window for a System Center - 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.
Examples
Example 1: Set a backup window
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
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.
Example 2: Modify the backup window of an existing 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
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.
Example 3: Create a protection group and specify a backup window
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
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.
Parameters
-DaysOfWeek
Specifies an array of days of the week.
The acceptable values for this parameter are:
- Su
- Mo
- Tu
- We
- Th
- Fr
- Sa
The default value is all days.
Type: | WeekDayType[] |
Accepted values: | Su, Mo, Tu, We, Th, Fr, Sa |
Position: | 2 |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DurationInHours
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.
Type: | Int32 |
Position: | 4 |
Default value: | None |
Required: | True |
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.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ProtectionGroup
Specifies a protection group for which this cmdlet sets a backup window. To obtain a ProtectionGroup object, use the Get-DPMProtectionGroup cmdlet.
Type: | ProtectionGroup |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-StartTime
Specifies the time of the day when the backup window for that day starts.
Type: | DateTime |
Position: | 3 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Related Links
- 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