Set-DPMBackupWindow
Set-DPMBackupWindow
Sets the backup window settings for a protection group.
構文
Parameter Set: Default
Set-DPMBackupWindow [-ProtectionGroup] <ProtectionGroup> [[-DaysOfWeek] {Su | Mo | Tu | We | Th | Fr | Sa}[] ] [-StartTime] <DateTime> [-DurationInHours] <Int32> [-PassThru] [ <CommonParameters>]
詳細説明
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.
パラメーター
-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.
エイリアス |
none |
必須? |
false |
位置は? |
2 |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
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 P.M. and the duration is 10 hours, the backup window for that day starts at 8 P.M. The window finishes at 6 A.M. the next day.
エイリアス |
none |
必須? |
true |
位置は? |
4 |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-PassThru
作業中の項目を表すオブジェクトを返します。既定では、このコマンドレットによる出力はありません。
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-ProtectionGroup<ProtectionGroup>
Specifies a ProtectionGroup object. To obtain a ProtectionGroup object, use the Get-DPMProtectionGroup cmdlet.
エイリアス |
none |
必須? |
true |
位置は? |
1 |
既定値 |
none |
パイプライン入力を許可する |
True (ByValue) |
ワイルドカード文字を許可する |
false |
-StartTime<DateTime>
Specifies the time of the day when the backup window for that day starts.
エイリアス |
none |
必須? |
true |
位置は? |
3 |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
<CommonParameters>
このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
出力
出力型は、コマンドレットによって生成されるオブジェクトの型です。
例
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 except ones that match the specified friendly name. For more information, type Get-Help Where-Object
. The command stores the protection group in the $ProtectionGroup variable.
The second command gets the protection group from the $ProtectionGroup in a modifiable form, and then stores it in the $ModifiableProtectionGroup variable.
The final command sets a backup window for the group stored in $ModifiableProtectionGroup. The window lasts 12 hours. It starts at 4 P.M. The command does not specify days on which backup windows occur. Therefore, they occur on every day.
PS C:\> $ProtectionGroup = Get-DPMProtectionGroup -DPMServerName "DPMServer02" | Where {$_.FriendlyName -like "*ContosoPG02*"}
PS C:\> $ModifiableProtectionGroup = Get-ModifiableProtectionGroup $ProtectionGroup
PS C:\> Set-DPMBackupWindow -ProtectionGroup $ModifiableProtectionGroup -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 $ProtectionGroup variable.
The second command gets the protection group from the $ProtectionGroup in a modifiable form, and then stores it in the $ModifiableProtectionGroup variable.
The third command gets the schedules for protection jobs, and then passes the results to Where-Object. That cmdlet drops all except ones that match the specified job type. The command stores the protection group in the $Schedule variable.
The fourth command sets a backup window for the protection group stored in $ModifiableProtectionGroup.
The fifth command sets a policy schedule for $ModifiableProtectionGroup based on the value stored in $Schedule.
The sixth command sets the consistency check window for $ModifiableProtectionGroup to start at midnight and last 24 hours.
The seventh command configures DPM consistency jobs to start at 2 A.M. and last up to three hours.
The final command saves all your changes to the protection group.
PS C:\> $ProtectionGroup = Get-DPMProtectionGroup -DPMServerName "DPMServer02" | Where {$_.FriendlyName -like "*ContosoPG02*"}
PS C:\> $ModifiableProtectionGroup = Get-DPMModifiableProtectionGroup $ProtectionGroup
PS C:\> $Schedule = Get-DPMPolicySchedule -ProtectionGroup $ModifiableProtectionGroup -ShortTerm | Where { $_.JobType -eq ""FullReplicationForApplication"" }
PS C:\> Set-DPMBackupWindow -ProtectionGroup $ModifiableProtectionGroup -StartTime 16:00 -DurationInHours 12
PS C:\> Set-DPMPolicySchedule -ProtectionGroup $ModifiableProtectionGroup -DaysOfWeek $Schedule.WeekDays -TimesOfDay $Schedule.TimesOfDay -Schedule $Schedule
PS C:\> Set-DPMConsistencyCheckWindow -ProtectionGroup $ModifiableProtectionGroup -StartTime 00:00 -DurationInHours 24
PS C:\> Set-DPMProtectionJobStartTime -ProtectionGroup $ModifiableProtectionGroup -JobType ConsistencyCheck -StartTime 02:00 -MaximumDurationInHours 3
PS C:\> Set-DPMProtectionGroup $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:\> $ProtectionGroup = New-DPMProtectionGroup -DPMServerName "DPMServer02" -Name 'SQL protection group'
PS C:\> $ProductionServer = Get-DPMProductionServer -DPMServerName "DPMCentral01"
PS C:\> $Datasource = Get-DPMDatasource -ProductionServer $ProductionServer -Inquire | Where {$_.DatasourceName -eq 'db1'}
PS C:\> Add-DPMChildDatasource -ProtectionGroup $ProtectionGroup -ChildDatasource $Datasource
PS C:\> Set-DPMProtectionType -ProtectionGroup $ProtectionGroup -ShortTerm disk
PS C:\> Set-DPMDatasourceDiskAllocation -Datasource $Datasource -ProtectionGroup $ProtectionGroup
PS C:\> Set-DPMReplicaCreationMethod -ProtectionGroup $ProtectionGroup -Manual
PS C:\> $Schedule = Get-DPMPolicySchedule -ProtectionGroup $ProtectionGroup -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 $ProtectionGroup -AutoConsistencyCheck $False
PS C:\> Set-DPMConsistencyCheckWindow -ProtectionGroup $ProtectionGroup -StartTime 22:00 -DurationInHours 12
PS C:\> Set-DPMProtectionJobStartTime -ProtectionGroup $ProtectionGroup -JobType ConsistencyCheck -StartTime 10:00 -MaximumDurationInHours 12
PS C:\> Set-DPMPolicyObjective -ProtectionGroup $ProtectionGroup -ColocateDatasources $False
PS C:\> Set-DPMProtectionGroup $ProtectionGroup