From e385e692ad6fe6d69039b61482e6c0477578711d Mon Sep 17 00:00:00 2001 From: Andrew Anushin Date: Wed, 10 May 2023 13:22:51 -0400 Subject: [PATCH] Release 3.19.0 --- .../convert-mbsbackupplantonbf.md | Bin 0 -> 6814 bytes docs/backup-agent/edit-mbsbackupplan.md | Bin 63414 -> 76964 bytes docs/backup-agent/edit-mbsnbfbackupplan.md | Bin 0 -> 73254 bytes docs/backup-agent/new-mbsbackupplan.md | Bin 37744 -> 37794 bytes .../new-mbsbackupplancommonoption.md | Bin 16560 -> 18914 bytes .../new-mbsnbfbackupplancommonoption.md | Bin 17266 -> 22732 bytes docs/backup-agent/new-mbsnbffilebackupplan.md | Bin 15706 -> 16240 bytes msp360.psd1 | 32 +- private/Add-MBSCBBType.ps1 | 15 +- private/New-MBSNBFBackupPlan.ps1 | 75 +- public/cbb/Convert-MBSBackupPlanToNBF.ps1 | 133 ++ public/cbb/Edit-MBSBackupPlan.ps1 | Bin 153126 -> 179890 bytes public/cbb/Edit-MBSNBFBackupPlan.ps1 | 1361 +++++++++++++++++ public/cbb/Get-MBSBackupPlan.ps1 | Bin 79270 -> 81920 bytes public/cbb/New-MBSBackupPlan.ps1 | 50 +- public/cbb/New-MBSBackupPlanCommonOption.ps1 | 38 +- .../cbb/New-MBSNBFBackupPlanCommonOption.ps1 | 72 +- public/cbb/New-MBSNBFFileBackupPlan.ps1 | 7 +- 18 files changed, 1729 insertions(+), 54 deletions(-) create mode 100644 docs/backup-agent/convert-mbsbackupplantonbf.md create mode 100644 docs/backup-agent/edit-mbsnbfbackupplan.md create mode 100644 public/cbb/Convert-MBSBackupPlanToNBF.ps1 create mode 100644 public/cbb/Edit-MBSNBFBackupPlan.ps1 diff --git a/docs/backup-agent/convert-mbsbackupplantonbf.md b/docs/backup-agent/convert-mbsbackupplantonbf.md new file mode 100644 index 0000000000000000000000000000000000000000..96c3363ce0633f1ef0a2224d6a15f1192a5929ee GIT binary patch literal 6814 zcmeI1YfoE85Qg__EcHJeL8O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*5COdrd{ISKYvC6+M@!+}DZ0@<}=) z?|S^UUFvb)?GtD1N8*N)Jy}0|b8#-&(5l?sc_sg}J({aP_Gh&wMdVW{IzlVwt(_a{H-_F-9fuPge#qcZ|}fQ$D%e(Sm=&VKg; t-Kt5?9oN84{+l}6G{o~x`bOLyXJBKLfWb{P(Cg-iMp?e*uu!Mpys< literal 0 HcmV?d00001 diff --git a/docs/backup-agent/edit-mbsbackupplan.md b/docs/backup-agent/edit-mbsbackupplan.md index a10dc3be92df172c228d5323d6e177329053048b..b4ffe922c507bafe0446a957d714272d750c6313 100644 GIT binary patch literal 76964 zcmeI5eNS9Rmd5YDL7MN-N>;KH4R-J(*_miIEBuzAH8u*Yt=;S>F*INg7<-@{hivw% z@9y)f!*NyJ_r}nno2wQt-Cb3;Zq-xg{ha%M|GQl9S}L}Rm&K$wEOv{pi&62Q7>D=E z#d>kK*woMSVy8GL-WG3)4Yhh+9I4NDYW-X-&(n8ZeJAS8)o%2<-VI&xd-Y;w$NIaY z{{OE34$sEmd%v4cdf&rm1+OK&{GLa}J>Bm^jc_xp$G&E{Q=Ar`>XYs8zpcYaYhf#K zEA;=V;I&lzAsMTE{XQx_(v0sFuZvfDz1Es;X#8XSyb7zctN%B{e@kllQSpOXuNC(- zkH6~kiN1ZQKKsQt#ou&IZ}Ir7e|szXzYf>h*A-TEhdX-zR^v^2U1PU+SM+XvGM&*8T1#N5{Q@bH-?&|EA{3dfpX|x%!dz<)v1DnLdBN+x=#+ z9`1V*cIW(Sa2)Wku30d9aMbVW&>34{KVw?~vAZ2Bu&TRkU!(iFuhZg*R%Sh{5V)Yn znpSI4{HeH8Lg_QjWLK2e`jyB2K_?%rMsK5bo3&W!f}<< ze4|xhEk69ts^d&|Z`J#=1c#8BAoH!lG&(6EBijUNHzXLn}rj-VH zPxbp)t7oHcgm?VkwU6FEJ=ai?e7vp`c5pU}N4i6HFz?-O_u-T9)l*SIQ;bxpvX8)tbE@1uPL4IM zp3~{`kKmMh+7VuBubh^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96031e9c4c4f485d9d09d556 100644 GIT binary patch delta 26 icmeycjA_wwrVTEfllSl%O%CJbn|vphZ*u~tKo&9CL(^VP@JCG#yMn+mX7~su1AEanwn5QjWo>IR5!Dj1+X*gF(_hjAUu80;&W1FYD)S!DbLAS9h z;*vontjciCaHwZ+V(VLHX&xc-@U7!JiTfp5pfgmk_EpNklE-6GjcPp86He?TPOBK@ zm4$x^KMPM5y&u>Z8xEYZ3aV3_j?roIk_XQ<(s|Mu@Lh(F`V&=T5s;Ko<{+25a*?7*4G~+Kv8leR z?8pi6u;1bHZOYH9!CSH!J)!**^{nV2zJ7S`V%>sAAg!&{jZlO4mJS6pPyh%Wj|N~> zz$$%oH>U_VRKyD4RV{0&NHwt5tzblJ@Kn?jkI+Fx06%auidzau0VqnOhR%W&P2DM2 zXR6^*3k)NX)^<4pP`;;NCBk6fpW{RRPFY<*aHW4%sxUPn14J9dCp#F5ZC20^d V-ZP+_TZ~|ahCdg}=8jMoW&j~bEtvoS diff --git a/docs/backup-agent/new-mbsnbffilebackupplan.md b/docs/backup-agent/new-mbsnbffilebackupplan.md index d998fc50cddac75047056d522d99e761a551b5ad..6c7789e3eecb328348064dbbcd9a5f0995c95fd5 100644 GIT binary patch delta 84 zcmcar^`UOVA7({whEyOdU~pw{V+aP4c?`)6MGTcdkrIYXhJ1#+&F`6;WyNtQo4ip> PbaRo)9>&c@iZ7%A^okds delta 17 ZcmexRcdKf{ALh+kEM>BrJCt8Y0{~Q~2uA<_ diff --git a/msp360.psd1 b/msp360.psd1 index 767ed4f..a98c499 100644 --- a/msp360.psd1 +++ b/msp360.psd1 @@ -6,7 +6,7 @@ CompanyName = 'MSP360' - ModuleVersion = '2.53.0' + ModuleVersion = '3.19.0' # Use the New-Guid command to generate a GUID, and copy/paste into the next line GUID = '69079da4-a0de-426d-bece-ae139c8b5f1a' @@ -48,21 +48,25 @@ # What new features, bug fixes, or deprecated features, are part of this release? ReleaseNotes = @" +- New cmdlets: + - Edit-MBSNBFBackupPlan (https://mspbackups.com/AP/Help/powershell/cmdlets/backup-agent/edit-mbsnbfbackupplan) + - Convert-MBSBackupPlanToNBF (https://mspbackups.com/AP/Help/powershell/cmdlets/backup-agent/convert-mbsbackupplantonbf) - Bugfix: - - Get-MBSBackupPlan: NBF plans - incorrect frequency is set if 'DayOfWeek' includes all days and the initial frequency is not 'Weekly' - - Get-MBSBackupPlan: NBF plans - 'DayOfWeek' for monthly incremental schedule is not set - - Get-MBSBackupPlan: NBF plans - 'DayOfMonth' value is not set if frequency is 'DayOfMonth' - - Get-MBSBackupPlan: NBF plans - 'RepeatInterval' and 'RepeatStartDate' are not set + - New-MBSNBFFileBackupPlan: -KeepVersionPeriod parameter does not work if backup agent version is from 7.8.0 to 7.8.2 + - New-MBSBackupPlan: schedule set incorrectly when incremental and full schedules are specified + - Edit-MBSBackupPlan: all backup chain parameters should be specified even if only one parameter change is needed + - Edit-MBSBackupPlan: backup chain is disabled if next backup plan ID in chain not specified in command for backup agent version 7.2.1 and higher - Enhancement: - - Get-MBSBackupPlan: RAW output type now returns NBF backup plans in their source (not converted) format in the same form as CBF backup plans - - Edit-MBSBackupPlan: adding and disabling file/folder exclusions for Image-Based backup plans improvements (MBS Backup Agent release 7.8.2) - - Stop-MBSPlan: force stop improvements (MBS Backup Agent release 7.8.2) - - Get-MBSAgentSetting, Get-MBSStorageAccount: added checks for cases when 'enginesettings.list' is empty, corrupt or incorrect format - - Get-MBSAPIBuild: added RMM build type - - Get-MBSAPIBuild: renamed build type values for convenience. Possible values - 'Windows','VMEdition','LinuxDEB','LinuxRPM','macOS','RMM' - - Request-MBSAPIBuild: introduced enums for -BuildType and -BuildEditions parameters - - Remove-MBSAgent, Remove-CONAgent, Remove-RMMAgent: output message improvements - - Set-MSP360ModuleSettings: added -SkipEngineSettingsListCheck parameter for cases when some cmdlets do not work properly if 'enginesettings.list' is not present (e.g. after MBS Backup Agent clean install, before assigning a backup user) + - New-MBSNBFBackupPlanCommonOption, Get-MBSBackupPlan: added support for -ForeverForwardIncremental and -IntelligentRetention parameters + - New-MBSNBFBackupPlanCommonOption: changed value type of parameter -KeepVersionPeriod from Timespan to Integer + - New-MBSBackupPlanCommonOption: changed value type of parameters -KeepVersionPeriod and -DelayPurgePeriod from Timespan to Integer + - New-MBSBackupPlanCommonOption, New-MBSNBFBackupPlanCommonOption: added backup chain parameters + - New-MBSNBFFileBackupPlan: added -KeepEFSEncryption parameter to back up EFS files as encrypted (MBS Backup Agent release 7.6.0) + - Edit-MBSBackupPlan: changed names for backup chain parameters (check help: https://mspbackups.com/AP/Help/powershell/cmdlets/backup-agent/edit-mbsbackupplan) + - Edit-MBSBackupPlan: added -SyntheticFull parameter for Image-Based backup plans + - Edit-MBSBackupPlan: added GlacierInstantRetrieval AWS S3 storage class support + - Edit-MBSBackupPlan: code optimization and minor bugfixes + - Updated help for Edit-MBSBackupPlan "@ } } diff --git a/private/Add-MBSCBBType.ps1 b/private/Add-MBSCBBType.ps1 index 101eef1..8624c8c 100644 --- a/private/Add-MBSCBBType.ps1 +++ b/private/Add-MBSCBBType.ps1 @@ -37,12 +37,15 @@ namespace MBS.Agent.Plan public Nullable PreActionContinueAnyway; public string PostActionCommand; public Nullable PostActionRunAnyway; + public string BackupChainPlanID; + public Nullable BackupChainExecuteOnlyAfterSuccess; + public Nullable BackupChainExecuteForceFull; public MBS.Agent.Plan.Notification ResultEmailNotification; public MBS.Agent.Plan.Notification AddEventToWindowsLog; - public Nullable KeepVersionPeriod; + public Nullable KeepVersionPeriod; public Nullable KeepNumberOfVersion; public bool KeepLastVersion; - public Nullable DelayPurgePeriod; + public Nullable DelayPurgePeriod; } public class NBFBackupPlanCommonOption { @@ -59,13 +62,18 @@ namespace MBS.Agent.Plan public Nullable PreActionContinueAnyway; public string PostActionCommand; public Nullable PostActionRunAnyway; + public string BackupChainPlanID; + public Nullable BackupChainExecuteOnlyAfterSuccess; + public Nullable BackupChainExecuteForceFull; public MBS.Agent.Plan.Notification ResultEmailNotification; public MBS.Agent.Plan.Notification AddEventToWindowsLog; - public Nullable KeepVersionPeriod; + public int KeepVersionPeriod; public int GFSKeepWeekly; public int GFSKeepMonthly; public int GFSKeepYearly; public MBS.Agent.Plan.Month GFSMonthOfTheYear; + public bool ForeverForwardIncremental; + public bool IntelligentRetention; } public class FileLevelBackupPlan : BackupPlan{ @@ -95,6 +103,7 @@ namespace MBS.Agent.Plan public bool BackupNTFSPermissions; public bool FastNTFSScan; public bool ForceUsingVSS; + public bool KeepEFSEncryption; public bool UseShareReadWriteModeOnError; public bool BackupEmptyFolders; public string BackupOnlyAfter; diff --git a/private/New-MBSNBFBackupPlan.ps1 b/private/New-MBSNBFBackupPlan.ps1 index f4f0267..46eb291 100644 --- a/private/New-MBSNBFBackupPlan.ps1 +++ b/private/New-MBSNBFBackupPlan.ps1 @@ -156,21 +156,62 @@ function New-MBSNBFBackupPlan { $Argument += " -paa no" } } + if ($Object.BackupPlanCommonOption.BackupChainPlanID) { + if ($CBBVersion -ge [version]"7.2.1.0") { + $Argument += " -chainPlanOn $($Object.BackupPlanCommonOption.BackupChainPlanID)" + if ($null -ne $Object.BackupPlanCommonOption.BackupChainExecuteOnlyAfterSuccess) { + if ($Object.BackupPlanCommonOption.BackupChainExecuteOnlyAfterSuccess) { + $Argument += " -chainPlanAfterSuccess yes" + }else{ + $Argument += " -chainPlanAfterSuccess no" + } + } + if ($null -ne $Object.BackupPlanCommonOption.BackupChainExecuteForceFull) { + if ($Object.BackupPlanCommonOption.BackupChainExecuteForceFull) { + $Argument += " -chainPlanForceFull yes" + }else{ + $Argument += " -chainPlanForceFull no" + } + } + }else{ + Write-Warning "Backup agent version is $CBBVersion. Backup chain parameters require version 7.2.1 or higher. Ignoring backup chain options" + } + } + if($Null -ne $Object.BackupPlanCommonOption.ResultEmailNotification){$Argument += " -notification $($Object.BackupPlanCommonOption.ResultEmailNotification)"} if($Null -ne $Object.BackupPlanCommonOption.AddEventToWindowsLog){$Argument += " -winLog $($Object.BackupPlanCommonOption.AddEventToWindowsLog)"} - if($Null -ne $Object.BackupPlanCommonOption.KeepVersionPeriod){ - if($Object.BackupPlanCommonOption.KeepVersionPeriod.TotalDays -gt 0){ - $Argument += " -purge $([Math]::Round($Object.BackupPlanCommonOption.KeepVersionPeriod.TotalDays))d" - }else{ + + if($Object.BackupPlanCommonOption.KeepVersionPeriod -gt 0){ + $Argument += " -purge $($Object.BackupPlanCommonOption.KeepVersionPeriod)d" + }else{ + if (-Not ($Object.BackupPlanCommonOption.ForeverForwardIncremental)) { $Argument += " -purge no" + } else { + Write-Warning """KeepVersionPeriod"" parameter is set to 0 while enabling Forever Forward Incremental. Setting ""KeepVersionPeriod"" value to 30 days (default)" + $Argument += " -purge 30d" } } - if($Object.BackupPlanCommonOption.GFSKeepWeekly -gt 0){$Argument += " -gfsW $($Object.BackupPlanCommonOption.GFSKeepWeekly)"} if($Object.BackupPlanCommonOption.GFSKeepMonthly -gt 0){$Argument += " -gfsM $($Object.BackupPlanCommonOption.GFSKeepMonthly)"} if($Object.BackupPlanCommonOption.GFSKeepYearly -gt 0){$Argument += " -gfsY $($Object.BackupPlanCommonOption.GFSKeepYearly)"} if($Object.BackupPlanCommonOption.GFSMonthOfTheYear -gt 0){$Argument += " -gfsYMonth $($Object.BackupPlanCommonOption.GFSMonthOfTheYear)"} + if($Object.BackupPlanCommonOption.ForeverForwardIncremental){ + if ($CBBVersion -ge [version]"7.8.0"){ + if ($Object.Schedule){ + $Argument += " -ffi yes" + if($Object.BackupPlanCommonOption.IntelligentRetention){ + $Argument += " -ir yes" + }else{ + $Argument += " -ir no" + } + }else{ + Write-Warning "Schedule settings not specified while enabling Forever Forward Incremental. Ignoring ForeverForwardIncremental option" + } + }else{ + Write-Warning "Backup agent version is $CBBVersion. ""ForeverForwardIncremental"" parameter requires version 7.8.0 or higher. Ignoring ForeverForwardIncremental option" + } + } switch ($PSCmdlet.ParameterSetName){ 'FileLevel' { @@ -182,6 +223,13 @@ function New-MBSNBFBackupPlan { } else { Write-Warning "MSP360ModuleSettings.SkipVSS is set. Ignoring ForceUsingVSS option" } + if ($Object.KeepEFSEncryption) { + if ($CBBVersion -ge [version]"7.6.0.70") { + $Argument += " -keepEfsEncryption yes" + }else{ + Write-Warning "Backup agent version is $CBBVersion. ""KeepEFSEncryption"" parameter requires version 7.6.0 or higher. Ignoring KeepEFSEncryption option" + } + } if ($Object.UseShareReadWriteModeOnError) {$Argument += " -sharerw yes"} if ($Object.BackupEmptyFolders) {$Argument += " -bef yes"} if ($Object.BackupOnlyAfter){$Argument += " -oa $($Object.BackupOnlyAfter.ToString('MM/dd/yyyy HH:mm tt'))"} @@ -324,8 +372,23 @@ function New-MBSNBFBackupPlan { $BPID = (Start-MBSProcess -CMDPath $CBB.CBBCLIPath -CMDArguments $Arguments -Output json -MasterPassword $MasterPassword -ErrorAction Stop).ID + if (($Null -ne $NBFFileLevelBackupPlan.BackupPlanCommonOption.KeepVersionPeriod) -And (($CBBVersion -ge [version]"7.8.0") -And ($CBBVersion -lt [version]"7.8.3"))) { + $ArgumentKeepVersionPeriod = " editBackupPlan -id $BPID" + if($NBFFileLevelBackupPlan.BackupPlanCommonOption.KeepVersionPeriod -gt 0){ + $ArgumentKeepVersionPeriod += " -purge $($NBFFileLevelBackupPlan.BackupPlanCommonOption.KeepVersionPeriod)d" + }else{ + if (-Not ($NBFFileLevelBackupPlan.BackupPlanCommonOption.ForeverForwardIncremental)) { + $ArgumentKeepVersionPeriod += " -purge no" + } else { + $ArgumentKeepVersionPeriod = "" + } + } + if ($ArgumentKeepVersionPeriod) { + Start-MBSProcess -CMDPath $CBB.CBBCLIPath -CMDArguments $ArgumentKeepVersionPeriod -Output json -MasterPassword $MasterPassword -ErrorAction Stop + } + } if ($NBFFileLevelBackupPlan.ExcludeItem -and ($CBBVersion -lt [version]"7.5.0")) { - $ArgumentsExcludeItem = " editBackupPlan -nbf -id $BPID" + $ArgumentsExcludeItem = " editBackupPlan -id $BPID" $NBFFileLevelBackupPlan.ExcludeItem | ForEach-Object -Process { if (Test-Path -Path $_ -PathType Container) { $ArgumentsExcludeItem += " -rd ""$_""" diff --git a/public/cbb/Convert-MBSBackupPlanToNBF.ps1 b/public/cbb/Convert-MBSBackupPlanToNBF.ps1 new file mode 100644 index 0000000..126a49e --- /dev/null +++ b/public/cbb/Convert-MBSBackupPlanToNBF.ps1 @@ -0,0 +1,133 @@ +function Convert-MBSBackupPlanToNBF { + <# + .SYNOPSIS + Converts the Legacy plan to the New Backup Format (NBF). + + .DESCRIPTION + Converts the Legacy backup format plan to the New Backup Format (NBF). The minimum supported version of the MBS backup agent is 7.8.3. + + .PARAMETER Name + Specify Plan Name. + + .PARAMETER ID + Specify Plan ID. + + .PARAMETER Force + Convert forcefully, ignoring warnings. + + .PARAMETER MasterPassword + Master password. Should be specified if configuration is protected by master password. Use -MasterPassword (ConvertTo-SecureString -string "Your_Password" -AsPlainText -Force) + + .PARAMETER PurgeLegacy + Allows to enable/disable purging of legacy data for converted plan. Possible values: $true/$false + + .EXAMPLE + Get-MBSBackupPlan -StorageType All -PlanFormat CBF -PlanType File-Level | Convert-MBSBackupPlanToNBF -PurgeLegacy + + Convert all Legacy file backup plans to New Backup Format. + + .EXAMPLE + Convert-MBSBackupPlanToNBF -Name test -Whatif + + Test conversion to New Backup Format of a backup plan named "test". If the command outputs warnings, the convertion should be performed with the -Force switch to ignore them. + + .NOTES + Author: MSP360 Onboarding Team + + .LINK + https://mspbackups.com/AP/Help/powershell/cmdlets/backup-agent/convert-mbsbackupplantonbf + + #> + + [CmdletBinding()] + param ( + # + [Parameter(ValueFromPipelineByPropertyName, HelpMessage='Plan ID')] + [string] + $ID, + # + [Parameter(ValueFromPipelineByPropertyName, HelpMessage='Plan name')] + [string] + $Name, + # + [Parameter(Mandatory=$False, HelpMessage='Master password. Should be specified if configuration is protected by master password. Use -MasterPassword (ConvertTo-SecureString -string ""Your_Password"" -AsPlainText -Force)')] + [SecureString] + $MasterPassword, + # + [Parameter(Mandatory=$False, HelpMessage='Allows to enable/disable purging of legacy data for converted plan. Possible values: $true/$false')] + [boolean] + $PurgeLegacy=$true, + # + [Parameter(Mandatory=$False, HelpMessage='Test conversion, no changes will be made')] + [switch] + $Whatif, + # + [Parameter(Mandatory=$False, HelpMessage='Perform conversion forcibly, ignore any warnings')] + [switch] + $Force, + # + [Parameter(Mandatory=$False, HelpMessage='Returns an object representing the resulting plan object. By default, this cmdlet does not generate any output.')] + [switch] + $PassThru + ) + + begin { + if (-not($CBB = Get-MBSAgent)) { + Break + } + if ([System.version](Get-MBSAgent).version -lt [System.version]"7.8.3.0") { + Write-Error "Version $($CBB.version) is not supported. Please upgrade to the minimum supported version 7.8.3" + Break + } + if (-Not(Test-MBSAgentMasterPassword)) { + $MasterPassword = $null + } else { + if (-Not(Test-MBSAgentMasterPassword -CheckMasterPassword -MasterPassword $MasterPassword)) { + $MasterPassword = Read-Host -AsSecureString -Prompt "Master Password" + if (-Not(Test-MBSAgentMasterPassword -CheckMasterPassword -MasterPassword $MasterPassword)) { + Write-Error "ERROR: Master password is not specified" + Break + } + } + } + } + + process { + + function Set-Argument{ + if ($ID){ + $Argument += " -id $ID" + }else{ + $Argument += " -n ""$Name""" + } + if ($Whatif){ + Write-Verbose "$($PSCmdlet.MyInvocation.MyCommand.Name): -WhatIf parameter specified. Plan will not be converted" + $Argument += " -whatif" + }else{ + if ($PurgeLegacy){ + $Argument += " -purgelegacy yes" + }else{ + $Argument += " -purgelegacy no" + } + } + if($Force){ + $Argument += " -force" + } + Return $Argument + } + + $Arguments = " convertToNBF" + $Arguments += Set-Argument + + $result = Start-MBSProcess -CMDPath $CBB.CBBCLIPath -CMDArguments $Arguments -Output json -MasterPassword $MasterPassword + + if (($PassThru) -And (-Not ($Whatif))) { + $PlanResult = (Get-MBSBackupPlan -PlanFormat NBF | Where-Object {$_.ID -eq $ID}) + return $PlanResult + } + } + + end { + + } +} \ No newline at end of file diff --git a/public/cbb/Edit-MBSBackupPlan.ps1 b/public/cbb/Edit-MBSBackupPlan.ps1 index 5e50d24e1116edf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KB)^Yu$mP1iKrs`{ z>q-N~$<*GCgx@L>a&Ec8ATqidRKt=%I<}f$D~5e8?}vsIitM@?>ddZjw%_e~M%lK> zav)p{BVT0i-gdL!#LX*5;5&%y6*VwVT<}_^?L|T7YrlHjMwrHx;+S%x4Yf{Pq*9k3Y9@?92H6H zN@^EBc$4kY+F4q@Vcy1UxxqOZaFIzufDVqay8Rlj+Q(Q}KA8Pv!>h})kme97C% z2_9+^t)ZNEv{KV}rkO4{{nOx9N;+by5_al9!Za6a8E{dIzeu-zxz5(cGBM#IJ$lF~ zxk(2lE1h!{-B#P)A*Chw2I{LOl|9reV%-roUn4BsMG5fjBh(;}74+EI)yJ6Rq+;41 z$tX7zro;SJ@Vmk5F6Q`7P7GwyHlvsIh;b#EW@0pRYHbYd!$HOMlUw{Ro-Y=NhO0A1=6ADuxklx z7)&(<+n3TSMlS_D@`;=wUq=?DQWqtsRjI688+k12>&nPkeX)$Qg=jrVj(KGnJED;o zR$`D=`ZdfbSYatm};m! z1fwmJv|N!&&GOA|B=k{sc7Uq#eWh|vGsS!-0 z&w2XLtD%Xm!X_mOFId<(Y)ohVcr}gD+nPAqzW1Hj!K*yQnyDDQjE%>N29~Un-%>n^ z9rV8F2q!>$8--!Vn-ps4N9k1iLhXb$awi0gX=imB>{L6^$+sTc0rrsyvS2hdfF92_ O)2F9VB$)SE%zpt-L&pgK diff --git a/public/cbb/Edit-MBSNBFBackupPlan.ps1 b/public/cbb/Edit-MBSNBFBackupPlan.ps1 new file mode 100644 index 0000000..a68a01d --- /dev/null +++ b/public/cbb/Edit-MBSNBFBackupPlan.ps1 @@ -0,0 +1,1361 @@ +function Edit-MBSNBFBackupPlan { + <# + .SYNOPSIS + Edit NBF backup plans. + .DESCRIPTION + Edit new backup format (NBF) backup plans. File-Level and Image-Based backup plan types are supported. + .PARAMETER FileLevel + Switch parameter for modifying settings of file-level backup plans only + .PARAMETER ImageBased + Switch parameter for modifying settings of image-based backup plans only + .PARAMETER All + Switch parameter for modifying settings present in any backup plan type (e.g. encryption, compression, retention policy, schedule) + .PARAMETER ID + Backup plan ID + .PARAMETER Name + Backup plan name + .PARAMETER StorageAccountID + Account Name or Account ID. Use Get-MBSStorageAccount to list storages + .PARAMETER NewName + Specify to rename plan + .PARAMETER DisableEncryption + Specify to disable encryption + .PARAMETER DisableSchedule + Specify to disable schedule + .PARAMETER SyncBeforeRun + Run consistency check before the plan + .PARAMETER ServerSideEncryption + Use server side encryption (valid only for Amazon S3) + .PARAMETER EncryptionAlgorithm + Enable AES encryption algorithm. Possible values: AES128, AES192, AES256 + .PARAMETER EncryptionPassword + Encryption password. Use -EncryptionPassword (ConvertTo-SecureString -string ""Your_Password"" -AsPlainText -Force) + .PARAMETER Compression + Enable compression + .PARAMETER StorageClass + Storage Class (valid only for Amazon S3). Possible values: Standard, IntelligentTiering, StandardIA, OneZoneIA, Glacier, GlacierInstantRetrieval, GlacierDeepArchive + .PARAMETER FullConsistencyCheck + Use full consistency check + .PARAMETER MasterPassword + Master password. Should be specified if configuration is protected by master password. Use -MasterPassword (ConvertTo-SecureString -string ""Your_Password"" -AsPlainText -Force) + .PARAMETER runMissed + Run missed scheduled backup immediately when computer starts up + .PARAMETER RecurringType + Specify schedule recurring type. Possible values: day, week, month, dayofmonth + .PARAMETER At + Specify datetime or time of schedule. Example -at ""06/09/19 7:43 AM"" , or -at ""7:43 AM"" for every day schedule + .PARAMETER DayOfMonth + Specify day for 'dayofmonth' schedule (1..31) + .PARAMETER WeekDay + Specify day(s) of week for weekly schedule. Example: ""su, mo, tu, we, th, fr, sa"". Or specify day of week for monthly schedule + .PARAMETER WeekNumber + Specify number of week. Possible values: First, Second, Third, Fourth, Penultimate, Last + .PARAMETER DailyFrom + Specify daily recurring from value + .PARAMETER DailyTill + Specify daily recurring till value + .PARAMETER Occurs + Specify recurring period type. Possible values: hour, min + .PARAMETER OccurValue + Specify recurring period value + .PARAMETER RepeatEvery + Specify repeat period value. Possible values: 1..31 + .PARAMETER RepeatStartDate + Specify start date of repetitions + .PARAMETER stopAfter + Specify time in HH:MM to stop the plan if it runs for HH hours MM minutes. Example -stopAfter ""20:30"" or -stopAfter ""100:00"" etc. + .PARAMETER ForeverForwardIncremental + Enable Forever Forward Incremental backup. Possible values: $true/$false + .PARAMETER preActionEnabled + Enables the pre-action + .PARAMETER preActionCommand + Specify command to be executed before the backup plan runs + .PARAMETER preActionContinueAnyway + Specify to continue backup plan if pre-backup action fails. Possible values: $true/$false + .PARAMETER postActionEnabled + Enables the post-action + .PARAMETER postActionCommand + Specify command to be executed after backup is completed + .PARAMETER postActionRunAnyway + Specify to execute post-backup action in any case (regardless of the backup result). Possible values: $true/$false + .PARAMETER notification + Specify to receive notification email when backup fails (errorOnly) or in all cases (on). Prior to turn on the notification settings must be configured. Possible values: errorOnly, on, off + .PARAMETER winLog + Specify to add entry to Windows Event Log when backup fails (errorOnly) or in all cases (on). Possible values: errorOnly, on, off + .PARAMETER DisableBackupChain + Specify to disable next/chained plan execution + .PARAMETER BackupChainPlanID + Specify chained plan ID. Use (Get-MBSBackupPlan | Where-Object Name -eq 'Backup plans name').ID or (Get-MBSRestorePlan | Where-Object Name -eq 'Backup plan name').ID + .PARAMETER BackupChainExecuteOnlyAfterSuccess + Specify to execute the chained plan only if the current plan is completed successfully ($true) or always ($false) + .PARAMETER BackupChainExecuteForceFull + Specify to force full backup for the chained plan. Possible values: $true/$false + .PARAMETER KeepVersionPeriod + Keep backups for specified number of days. Set 0 to keep all versions or specify number of days. Example: -KeepVersionPeriod 90 + .PARAMETER GFSKeepWeekly + Keep weekly full backups using GFS retention policy. Set 0 to disable or specify number of weeks. Example: -GFSKeepWeekly 4 + .PARAMETER GFSKeepMonthly + Keep monthly full backups using GFS retention policy. Set 0 to disable or specify number of months. Example: -GFSKeepMonthly 12 + .PARAMETER GFSKeepYearly + Keep yearly full backups using GFS retention policy. Set 0 to disable or specify number of years. Example: -GFSKeepYearly 5 + .PARAMETER GFSMonthOfTheYear + Specify the month for the first successful full backup to be marked for GFS yearly retention. Example: -GFSMonthOfTheYear January + .PARAMETER IntelligentRetention + Enable Intelligent Retention for Forever Forward Incremental. Possible values: $true/$false. By default set to $true if Forever Forward Incremental is enabled + .PARAMETER RecurringTypeForceFull + Specify force full schedule recurring type. Possible values: day, week, month, dayofmonth + .PARAMETER DayOfMonthForceFull + Specify day for 'dayofmonth' force full schedule (1..31) + .PARAMETER weekdayForceFull + Specify day(s) of week for weekly force full schedule. Example: ""su, mo, tu, we, th, fr, sa"". Or specify day of week for monthly force full schedule + .PARAMETER repeatEveryForceFull + Specify force full repeat period value. Possible values: 1..31 + .PARAMETER repeatStartDateForceFull + Specify force full start date of repetitions + .PARAMETER DisableForceFullSchedule + Specify to disable schedule of forced full backup + .PARAMETER SyntheticFull + Use Synthetic Full backup (this parameter is NOT supported for all storage providers). Possible values: $true/$false + .PARAMETER UseFastNTFSScan + The Fast NTFS scan speeds up backup processing by using a low-level API for accessing NTFS structures. This option is useful for NTFS volumes with a large number of files. Enabling this option automatically enables ForceUsingVSS option. Possible values: $true/$false + .PARAMETER BackupNTFSPermissions + Backup NTFS permissions. Possible values: $true/$false + .PARAMETER ForceUsingVSS + Force using VSS (Volume Shadow Copy Service). Cannot be disabled if UseFastNTFSScan is enabled. Possible values: $true/$false + .PARAMETER KeepEFSEncryption + Back up EFS files as encrypted. Possible values: $true/$false + .PARAMETER UseShareReadWriteModeOnError + Use share read/write mode on errors. Can help if file is open in share read/write mode. Possible values: $true/$false + .PARAMETER BackupEmptyFolders + Backup empty folders. Possible values: $true/$false + .PARAMETER BackupOnlyAfter + Backup files only after specific date. Example: ""06/09/19 7:43 AM"" + .PARAMETER ExcludeSystemHiddenFiles + Exclude system and hidden files and folders. Possible values: $true/$false + .PARAMETER SkipFolders + Skip folders with specified names (recursively). Example: -SkipFolders ""bin"",""*temp*"",""My*"" + .PARAMETER IncludeFilesMask + Select files by mask to include in the backup plan. Example: -ifm ""*.doc"",""*.xls"" + .PARAMETER ExcludeFilesMask + Select files by mask to exclude from the backup plan. Example: -efm ""*.bak"",""*.tmp"" + .PARAMETER IgnoreErrorPathNotFound + Ignore path not found errors. Possible values: $true/$false + .PARAMETER AddNewFile + Add a new file to backup plan + .PARAMETER AddNewDirectory + Add a new directory to backup plan + .PARAMETER ExcludeFile + Exclude a file from backup plan + .PARAMETER ExcludeDirectory + Exclude a directory from backup plan + .PARAMETER BackupFile + Specify files to backup + .PARAMETER BackupDirectory + Specify directories to backup + .PARAMETER GenerateDetailedReport + Specify to generate detailed report. Possible values: $true/$false + .PARAMETER BackupVolumes + Type of volumes to backup. Possible values: AllVolumes, FixedVolumes, SystemRequired, SelectedVolumes + .PARAMETER Volumes + Backup selected volumes with the specified IDs. Example: -Volumes ((Get-MBSDiskVolume).Volumes | Where {`$_.RequiredBySystem -eq `$true}).WindowsVolumeIdentity + .PARAMETER disableVSS + Disable VSS, use direct access to NTFS volume. Possible values: $true/$false + .PARAMETER KeepBitLocker + Enable or disable KeepBitLocker option for all partitions. Possible values: $true/$false + .PARAMETER ignoreBadSectors + Ignore bad sectors. Possible values: $true/$false + .PARAMETER useSystemVSS + Use system VSS provider. Possible values: $true/$false + .PARAMETER prefetchBlockCount + Prefetch block count (0 - 100, 0 without prefetch) + .PARAMETER blockSize + Block size. Possible values: 128, 256, 512, 1024 + .PARAMETER ExcludeItem + Exclude files/folders from Image-Based backup plan + .PARAMETER DisableExcludeFilesFolders + Disable the 'Exclude files/folders' option in Image-Based backup plan + .PARAMETER KeepBitLockerEnableForVolume + Enable KeepBitLocker option for volumes with specified IDs + .PARAMETER KeepBitLockerDisableForVolume + Disable KeepBitLocker option for volumes with specified IDs + .PARAMETER RestoreVerificationMode + Run restore verification mode. Possible values: DoNotRun, RunForFull, RunForIncremental, RunForFullAndIncremental + .EXAMPLE + PS C:\> Get-MBSBackupPlan -PlanFormat NBF | Edit-MBSNBFBackupPlan -All -Compression $true + Enable compression option for all new format backup plans. + .EXAMPLE + PS C:\> Edit-MBSNBFBackupPlan -FileLevel -Name 'Files' -ForeverForwardIncremental $true -KeepVersionPeriod 90 -RecurringType day -At 22:00 + Enable forever forward incremental backup for plan with name 'Files' and set it to run every day at 10:00 PM and keep all backups for 3 months. + .EXAMPLE + PS C:\> Get-MBSBackupPlan -PlanType Image-Based -PlanFormat NBF | Edit-MBSNBFBackupPlan -ImageBased -ExcludeItem (Get-ChildItem -Path 'C:\Users' -Recurse | Where-Object {$_.PSIsContainer -eq $true -and $_.Name -match 'OneDrive'}).FullName + Exclude all OneDrive folders in 'C:\Users' (recursively) in all new format image-based backup plans. + .EXAMPLE + PS C:\> Get-MBSBackupPlan -StorageType Cloud -PlanType Image-Based -PlanFormat NBF | Edit-MBSNBFBackupPlan -ImageBased -BackupVolumes SystemRequired + Add only system required volumes to cloud image-based backup plans. + .EXAMPLE + PS C:\> Get-MBSBackupPlan -PlanFormat NBF | Where {$_.Name -like 'Share*'} | Edit-MBSNBFBackupPlan -All -StorageAccountID (Get-MBSStorageAccount | Where {$_.DisplayName -like 'Wasabi'}).ID + Change storage account to Wasabi in all NBF backup plans which names start with 'Share' + .INPUTS + System.Management.Automation.PSCustomObject + .OUTPUTS + System.Management.Automation.PSCustomObject + .NOTES + Author: MSP360 Onboarding Team + .LINK + https://mspbackups.com/AP/Help/powershell/cmdlets/backup-agent/edit-mbsnbfbackupplan + #> + + [CmdletBinding(DefaultParameterSetName='Common')] + param ( + # + [Parameter(Mandatory=$True, HelpMessage="Switch parameter for modifying settings of file-level backup plans only", ParameterSetName='FileLevel')] + [switch] + $FileLevel, + # + [Parameter(Mandatory=$True, HelpMessage="Switch parameter for modifying settings of image-based backup plans only", ParameterSetName='ImageBased')] + [switch] + $ImageBased, + # + [Parameter(Mandatory=$True, HelpMessage="Switch parameter for modifying settings present in any backup plan type (e.g. encryption, compression, retention policy, schedule)", ParameterSetName='Common')] + [switch] + $All, + # + [Parameter(ValueFromPipelineByPropertyName, HelpMessage="Backup plan ID")] + [string] + $ID, + # + [Parameter(ValueFromPipelineByPropertyName, HelpMessage="Backup plan name")] + [string] + $Name, + # + [Parameter(Mandatory=$False, HelpMessage="Account Name or Account ID. Use Get-MBSStorageAccount to list storages", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Account Name or Account ID. Use Get-MBSStorageAccount to list storages", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Account Name or Account ID. Use Get-MBSStorageAccount to list storages", ParameterSetName='FileLevel')] + [string] + $StorageAccountID, + # + [Parameter(Mandatory=$False, HelpMessage="Specify to rename plan", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify to rename plan", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify to rename plan", ParameterSetName='FileLevel')] + [String] + $NewName, + # + [Parameter(Mandatory=$False, HelpMessage="Specify to disable encryption", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify to disable encryption", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify to disable encryption", ParameterSetName='FileLevel')] + [switch] + $DisableEncryption, + # + [Parameter(Mandatory=$False, HelpMessage="Specify to disable schedule", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify to disable schedule", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify to disable schedule", ParameterSetName='FileLevel')] + [switch] + $DisableSchedule, + # + [Parameter(Mandatory=$False, HelpMessage="Run consistency check before the plan", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Run consistency check before the plan", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Run consistency check before the plan", ParameterSetName='FileLevel')] + [Nullable[boolean]] + $SyncBeforeRun, + # + [Parameter(Mandatory=$False, HelpMessage="Use server side encryption (valid only for Amazon S3)", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Use server side encryption (valid only for Amazon S3)", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Use server side encryption (valid only for Amazon S3)", ParameterSetName='FileLevel')] + [Nullable[boolean]] + $ServerSideEncryption, + # + [Parameter(Mandatory=$False, HelpMessage="Enable AES encryption algorithm. Possible values: AES128, AES192, AES256", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Enable AES encryption algorithm. Possible values: AES128, AES192, AES256", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Enable AES encryption algorithm. Possible values: AES128, AES192, AES256", ParameterSetName='FileLevel')] + [ValidateSet("AES128", "AES192","AES256")] + [String] + $EncryptionAlgorithm, + # + [Parameter(Mandatory=$False, HelpMessage="Encryption password. Use -EncryptionPassword (ConvertTo-SecureString -string ""Your_Password"" -AsPlainText -Force)", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Encryption password. Use -EncryptionPassword (ConvertTo-SecureString -string ""Your_Password"" -AsPlainText -Force)", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Encryption password. Use -EncryptionPassword (ConvertTo-SecureString -string ""Your_Password"" -AsPlainText -Force)", ParameterSetName='FileLevel')] + [SecureString] + $EncryptionPassword, + # + [Parameter(Mandatory=$False, HelpMessage="Enable compression", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Enable compression", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Enable compression", ParameterSetName='FileLevel')] + [Nullable[boolean]] + $Compression, + # + [Parameter(Mandatory=$False, HelpMessage="Storage Class (valid only for Amazon S3). Possible values: Standard, IntelligentTiering, StandardIA, OneZoneIA, Glacier, GlacierInstantRetrieval, GlacierDeepArchive", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Storage Class (valid only for Amazon S3). Possible values: Standard, IntelligentTiering, StandardIA, OneZoneIA, Glacier, GlacierInstantRetrieval, GlacierDeepArchive", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Storage Class (valid only for Amazon S3). Possible values: Standard, IntelligentTiering, StandardIA, OneZoneIA, Glacier, GlacierInstantRetrieval, GlacierDeepArchive", ParameterSetName='FileLevel')] + [ValidateSet("Standard", "IntelligentTiering", "StandardIA", "OneZoneIA", "Glacier", "GlacierInstantRetrieval", "GlacierDeepArchive")] + [String] + $StorageClass, + # + [Parameter(Mandatory=$False, HelpMessage="Use full consistency check", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Use full consistency check", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Use full consistency check", ParameterSetName='FileLevel')] + [Nullable[boolean]] + $FullConsistencyCheck, + # + [Parameter(Mandatory=$False, HelpMessage="Master password. Should be specified if configuration is protected by master password. Use -MasterPassword (ConvertTo-SecureString -string ""Your_Password"" -AsPlainText -Force)", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Master password. Should be specified if configuration is protected by master password. Use -MasterPassword (ConvertTo-SecureString -string ""Your_Password"" -AsPlainText -Force)", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Master password. Should be specified if configuration is protected by master password. Use -MasterPassword (ConvertTo-SecureString -string ""Your_Password"" -AsPlainText -Force)", ParameterSetName='FileLevel')] + [SecureString] + $MasterPassword, + # ------------------------- Schedule ----------------------------- + [Parameter(Mandatory=$False, HelpMessage='Run missed scheduled backup immediately when computer starts up', ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage='Run missed scheduled backup immediately when computer starts up', ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage='Run missed scheduled backup immediately when computer starts up', ParameterSetName='FileLevel')] + [Nullable[boolean]] + $runMissed, + # + [Parameter(Mandatory=$False, HelpMessage="Specify schedule recurring type. Possible values: day, week, month, dayofmonth", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify schedule recurring type. Possible values: day, week, month, dayofmonth", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify schedule recurring type. Possible values: day, week, month, dayofmonth", ParameterSetName='FileLevel')] + [ValidateSet("day", "week", "month", "dayofmonth")] + [String] + $RecurringType, + # + [Parameter(Mandatory=$False, HelpMessage="Specify datetime or time of schedule. Example -at ""06/09/19 7:43 AM"" , or -at ""7:43 AM""", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify datetime or time of schedule. Example -at ""06/09/19 7:43 AM"" , or -at ""7:43 AM""", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify datetime or time of schedule. Example -at ""06/09/19 7:43 AM"" , or -at ""7:43 AM""", ParameterSetName='FileLevel')] + [String] + $At, + # + [Parameter(Mandatory=$False, HelpMessage="Specify day for 'dayofmonth' schedule (1..31)", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify day for 'dayofmonth' schedule (1..31)", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify day for 'dayofmonth' schedule (1..31)", ParameterSetName='FileLevel')] + [Int32][ValidateRange(1,31)] + $DayOfMonth, + # + [Parameter(Mandatory=$False, HelpMessage="Specify day(s) of week for weekly schedule. Example: ""su, mo, tu, we, th, fr, sa"". Or specify day of week for monthly schedule", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify day(s) of week for weekly schedule. Example: ""su, mo, tu, we, th, fr, sa"". Or specify day of week for monthly schedule", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify day(s) of week for weekly schedule. Example: ""su, mo, tu, we, th, fr, sa"". Or specify day of week for monthly schedule", ParameterSetName='FileLevel')] + [ValidateSet("su", "mo", "tu", "we", "th", "fr", "sa")] + [string[]] + $WeekDay, + # + [Parameter(Mandatory=$False, HelpMessage="Specify number of week. Possible values: First, Second, Third, Fourth, Penultimate, Last", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify number of week. Possible values: First, Second, Third, Fourth, Penultimate, Last", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify number of week. Possible values: First, Second, Third, Fourth, Penultimate, Last", ParameterSetName='FileLevel')] + [ValidateSet("First", "Second", "Third", "Fourth", "Penultimate", "Last")] + [string] + $WeekNumber, + # + [Parameter(Mandatory=$False, HelpMessage="Specify daily recurring from value", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify daily recurring from value", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify daily recurring from value", ParameterSetName='FileLevel')] + [string] + $DailyFrom, + # + [Parameter(Mandatory=$False, HelpMessage="Specify daily recurring till value", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify daily recurring till value", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify daily recurring till value", ParameterSetName='FileLevel')] + [string] + $DailyTill, + # + [Parameter(Mandatory=$False, HelpMessage="Specify recurring period type. Possible values: hour, min", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify recurring period type. Possible values: hour, min", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify recurring period type. Possible values: hour, min", ParameterSetName='FileLevel')] + [ValidateSet("hour", "min")] + [string] + $Occurs, + # + [Parameter(Mandatory=$False, HelpMessage="Specify recurring period value", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify recurring period value", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify recurring period value", ParameterSetName='FileLevel')] + [Alias("OccursValue")] + [string] + $OccurValue, + # + [Parameter(Mandatory=$False, HelpMessage="Specify repeat period value. Possible values: 1..31", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify repeat period value. Possible values: 1..31", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify repeat period value. Possible values: 1..31", ParameterSetName='FileLevel')] + [Int32][ValidateRange(1,31)] + $RepeatEvery, + # + [Parameter(Mandatory=$False, HelpMessage="Specify start date of repetitions", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify start date of repetitions", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify start date of repetitions", ParameterSetName='FileLevel')] + [string] + $RepeatStartDate, + # + [Parameter(Mandatory=$False, HelpMessage="Specify time in HH:MM to stop the plan if it runs for HH hours MM minutes. Example -stopAfter ""20:30"" or -stopAfter ""100:00"" etc.", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify time in HH:MM to stop the plan if it runs for HH hours MM minutes. Example -stopAfter ""20:30"" or -stopAfter ""100:00"" etc.", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify time in HH:MM to stop the plan if it runs for HH hours MM minutes. Example -stopAfter ""20:30"" or -stopAfter ""100:00"" etc.", ParameterSetName='FileLevel')] + [string] + $stopAfter, + # + [Parameter(Mandatory=$False, HelpMessage='Enable Forever Forward Incremental backup. Possible values: $true/$false', ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage='Enable Forever Forward Incremental backup. Possible values: $true/$false', ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage='Enable Forever Forward Incremental backup. Possible values: $true/$false', ParameterSetName='FileLevel')] + [Nullable[boolean]] + $ForeverForwardIncremental, + # ------------------ Pre / Post actions ---------------------------- + [Parameter(Mandatory=$False, HelpMessage="Enables the pre-action", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Enables the pre-action", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Enables the pre-action", ParameterSetName='FileLevel')] + [Alias("prae")] + [Nullable[boolean]] + $preActionEnabled, + # + [Parameter(Mandatory=$False, HelpMessage="Specify command to be executed before the backup plan runs", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify command to be executed before the backup plan runs", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify command to be executed before the backup plan runs", ParameterSetName='FileLevel')] + [Alias("preAction")] + [string] + $preActionCommand, + # + [Parameter(Mandatory=$False, HelpMessage='Specify to continue backup plan if pre-backup action fails. Possible values: $true/$false', ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage='Specify to continue backup plan if pre-backup action fails. Possible values: $true/$false', ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage='Specify to continue backup plan if pre-backup action fails. Possible values: $true/$false', ParameterSetName='FileLevel')] + [Alias("pac")] + [Nullable[boolean]] + $preActionContinueAnyway, + # + [Parameter(Mandatory=$False, HelpMessage="Enables the post-action", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Enables the post-action", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Enables the post-action", ParameterSetName='FileLevel')] + [Alias("ppae")] + [Nullable[boolean]] + $postActionEnabled, + # + [Parameter(Mandatory=$False, HelpMessage="Specify command to be executed after backup is completed", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify command to be executed after backup is completed", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify command to be executed after backup is completed", ParameterSetName='FileLevel')] + [Alias("postAction")] + [string] + $postActionCommand, + # + [Parameter(Mandatory=$False, HelpMessage='Specify to execute post-backup action in any case (regardless of the backup result). Possible values: $true/$false', ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage='Specify to execute post-backup action in any case (regardless of the backup result). Possible values: $true/$false', ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage='Specify to execute post-backup action in any case (regardless of the backup result). Possible values: $true/$false', ParameterSetName='FileLevel')] + [Alias("paa")] + [Nullable[boolean]] + $postActionRunAnyway, + # + [Parameter(Mandatory=$False, HelpMessage="Specify to receive notification email when backup fails (errorOnly) or in all cases (on). Prior to turn on the notification settings must be configured. Possible values: errorOnly, on, off", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify to receive notification email when backup fails (errorOnly) or in all cases (on). Prior to turn on the notification settings must be configured. Possible values: errorOnly, on, off", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify to receive notification email when backup fails (errorOnly) or in all cases (on). Prior to turn on the notification settings must be configured. Possible values: errorOnly, on, off", ParameterSetName='FileLevel')] + [ValidateSet("errorOnly", "on", "off")] + [string] + $notification, + # + [Parameter(Mandatory=$False, HelpMessage="Specify to add entry to Windows Event Log when backup fails (errorOnly) or in all cases (on). Possible values: errorOnly, on, off", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify to add entry to Windows Event Log when backup fails (errorOnly) or in all cases (on). Possible values: errorOnly, on, off", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify to add entry to Windows Event Log when backup fails (errorOnly) or in all cases (on). Possible values: errorOnly, on, off", ParameterSetName='FileLevel')] + [ValidateSet("errorOnly", "on", "off")] + [string] + $winLog, + # + [Parameter(Mandatory=$False, HelpMessage='Specify to disable next/chained plan execution', ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage='Specify to disable next/chained plan execution', ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage='Specify to disable next/chained plan execution', ParameterSetName='FileLevel')] + [switch] + $DisableBackupChain, + # + [Parameter(Mandatory=$False, HelpMessage="Specify chained plan ID. Use (Get-MBSBackupPlan | Where-Object Name -eq 'Backup plans name').ID or (Get-MBSRestorePlan | Where-Object Name -eq 'Backup plan name').ID", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify chained plan ID. Use (Get-MBSBackupPlan | Where-Object Name -eq 'Backup plans name').ID or (Get-MBSRestorePlan | Where-Object Name -eq 'Backup plan name').ID", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify chained plan ID. Use (Get-MBSBackupPlan | Where-Object Name -eq 'Backup plans name').ID or (Get-MBSRestorePlan | Where-Object Name -eq 'Backup plan name').ID", ParameterSetName='FileLevel')] + [string] + $BackupChainPlanID, + # + [Parameter(Mandatory=$False, HelpMessage='Specify to execute the chained plan only if the current plan is completed successfully ($true) or always ($false)', ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage='Specify to execute the chained plan only if the current plan is completed successfully ($true) or always ($false)', ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage='Specify to execute the chained plan only if the current plan is completed successfully ($true) or always ($false)', ParameterSetName='FileLevel')] + [Nullable[boolean]] + $BackupChainExecuteOnlyAfterSuccess, + # + [Parameter(Mandatory=$False, HelpMessage='Specify to force full backup for the chained plan. Possible values: $true/$false', ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage='Specify to force full backup for the chained plan. Possible values: $true/$false', ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage='Specify to force full backup for the chained plan. Possible values: $true/$false', ParameterSetName='FileLevel')] + [Nullable[boolean]] + $BackupChainExecuteForceFull, + # ---------------------------- Retention Policy ------------------------- + [Parameter(Mandatory=$False, HelpMessage="Keep backups for specified number of days. Set 0 to keep all versions or specify number of days. Example: -KeepVersionPeriod 90", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Keep backups for specified number of days. Set 0 to keep all versions or specify number of days. Example: -KeepVersionPeriod 90", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Keep backups for specified number of days. Set 0 to keep all versions or specify number of days. Example: -KeepVersionPeriod 90", ParameterSetName='FileLevel')] + [Alias("purge")] + [Nullable[int]] + $KeepVersionPeriod, + # + [Parameter(Mandatory=$False, HelpMessage="Keep weekly full backups using GFS retention policy. Set 0 to disable or specify number of weeks. Example: -GFSKeepWeekly 4", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Keep weekly full backups using GFS retention policy. Set 0 to disable or specify number of weeks. Example: -GFSKeepWeekly 4", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Keep weekly full backups using GFS retention policy. Set 0 to disable or specify number of weeks. Example: -GFSKeepWeekly 4", ParameterSetName='FileLevel')] + [ValidateRange(0,100000)] + [Nullable[int]] + $GFSKeepWeekly, + # + [Parameter(Mandatory=$False, HelpMessage="Keep monthly full backups using GFS retention policy. Set 0 to disable or specify number of months. Example: -GFSKeepMonthly 12", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Keep monthly full backups using GFS retention policy. Set 0 to disable or specify number of months. Example: -GFSKeepMonthly 12", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Keep monthly full backups using GFS retention policy. Set 0 to disable or specify number of months. Example: -GFSKeepMonthly 12", ParameterSetName='FileLevel')] + [ValidateRange(0,10000)] + [Nullable[int]] + $GFSKeepMonthly, + # + [Parameter(Mandatory=$False, HelpMessage="Keep yearly full backups using GFS retention policy. Set 0 to disable or specify number of years. Example: -GFSKeepYearly 5", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Keep yearly full backups using GFS retention policy. Set 0 to disable or specify number of years. Example: -GFSKeepYearly 5", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Keep yearly full backups using GFS retention policy. Set 0 to disable or specify number of years. Example: -GFSKeepYearly 5", ParameterSetName='FileLevel')] + [ValidateRange(0,1000)] + [Nullable[int]] + $GFSKeepYearly, + # + [Parameter(Mandatory=$False, HelpMessage="Specify the month for the first successful full backup to be marked for GFS yearly retention. Example: -GFSMonthOfTheYear January", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify the month for the first successful full backup to be marked for GFS yearly retention. Example: -GFSMonthOfTheYear January", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify the month for the first successful full backup to be marked for GFS yearly retention. Example: -GFSMonthOfTheYear January", ParameterSetName='FileLevel')] + [MBS.Agent.Plan.Month] + $GFSMonthOfTheYear, + # + [Parameter(Mandatory=$False, HelpMessage='Enable Intelligent Retention for Forever Forward Incremental. Possible values: $true/$false. By default set to $true if Forever Forward Incremental is enabled', ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage='Enable Intelligent Retention for Forever Forward Incremental. Possible values: $true/$false. By default set to $true if Forever Forward Incremental is enabled', ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage='Enable Intelligent Retention for Forever Forward Incremental. Possible values: $true/$false. By default set to $true if Forever Forward Incremental is enabled', ParameterSetName='FileLevel')] + [Nullable[boolean]] + $IntelligentRetention, + #-------------------------Full schedule ----------------------------------- + [Parameter(Mandatory=$False, HelpMessage="Specify force full schedule recurring type. Possible values: day, week, month, dayofmonth", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify force full schedule recurring type. Possible values: day, week, month, dayofmonth", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify force full schedule recurring type. Possible values: day, week, month, dayofmonth", ParameterSetName='FileLevel')] + [ValidateSet("day", "week", "month", "dayofmonth")] + [string] + $RecurringTypeForceFull, + # + [Parameter(Mandatory=$False, HelpMessage="Specify day for 'dayofmonth' force full schedule (1..31)", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify day for 'dayofmonth' force full schedule (1..31)", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify day for 'dayofmonth' force full schedule (1..31)", ParameterSetName='FileLevel')] + [Int32][ValidateRange(1,31)] + $DayOfMonthForceFull, + # + [Parameter(Mandatory=$False, HelpMessage="Specify day(s) of week for weekly force full schedule. Example: ""su, mo, tu, we, th, fr, sa"". Or specify day of week for monthly force full schedule", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify day(s) of week for weekly force full schedule. Example: ""su, mo, tu, we, th, fr, sa"". Or specify day of week for monthly force full schedule", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify day(s) of week for weekly force full schedule. Example: ""su, mo, tu, we, th, fr, sa"". Or specify day of week for monthly force full schedule", ParameterSetName='FileLevel')] + [ValidateSet("su", "mo", "tu", "we", "th", "fr", "sa")] + [string[]] + $weekdayForceFull, + # + [Parameter(Mandatory=$False, HelpMessage="Specify force full repeat period value. Possible values: 1..31", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify force full repeat period value. Possible values: 1..31", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify force full repeat period value. Possible values: 1..31", ParameterSetName='FileLevel')] + [Int32][ValidateRange(1,31)] + $repeatEveryForceFull, + # + [Parameter(Mandatory=$False, HelpMessage="Specify force full start date of repetitions", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify force full start date of repetitions", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify force full start date of repetitions", ParameterSetName='FileLevel')] + [string] + $repeatStartDateForceFull, + # + #[Parameter(Mandatory=$False, HelpMessage="Specify force full start date of repetitions", ParameterSetName='GFS')] + #[Parameter(Mandatory=$False, HelpMessage="Specify rebackup datetime. Example: ""06/09/19 7:43 AM""", ParameterSetName='FileLevel')] + #[string] + #$rebackupDate, + # + [Parameter(Mandatory=$False, HelpMessage="Specify to disable schedule of forced full backup", ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage="Specify to disable schedule of forced full backup", ParameterSetName='ImageBased')] + [Parameter(Mandatory=$False, HelpMessage="Specify to disable schedule of forced full backup", ParameterSetName='FileLevel')] + [switch] + $DisableForceFullSchedule, + # + #[Parameter(Mandatory=$False, HelpMessage='Use Synthetic Full backup (this parameter is NOT supported for all storage providers). Possible values: $true/$false', ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage='Use Synthetic Full backup (this parameter is NOT supported for all storage providers). Possible values: $true/$false', ParameterSetName='ImageBased')] + #[Parameter(Mandatory=$False, HelpMessage='Use Synthetic Full backup (this parameter is NOT supported for all storage providers). Possible values: $true/$false', ParameterSetName='FileLevel')] + [Nullable[boolean]] + $SyntheticFull, + # --------------------------- File Backup settings ------------ + [Parameter(Mandatory=$False, HelpMessage='The Fast NTFS scan speeds up backup processing by using a low-level API for accessing NTFS structures. This option is useful for NTFS volumes with a large number of files. Enabling this option automatically enables ForceUsingVSS option. Possible values: $true/$false', ParameterSetName='FileLevel')] + [Nullable[boolean]] + $UseFastNTFSScan, + # + [Parameter(Mandatory=$False, HelpMessage='Backup NTFS permissions. Possible values: $true/$false', ParameterSetName='FileLevel')] + [Nullable[boolean]] + $BackupNTFSPermissions, + # + [Parameter(Mandatory=$False, HelpMessage='Force using VSS (Volume Shadow Copy Service). Cannot be disabled if UseFastNTFSScan is enabled. Possible values: $true/$false', ParameterSetName='FileLevel')] + [Nullable[boolean]] + $ForceUsingVSS, + # + [Parameter(Mandatory=$False, HelpMessage='Back up EFS files as encrypted. Possible values: $true/$false', ParameterSetName='FileLevel')] + [Nullable[boolean]] + $KeepEFSEncryption, + # + [Parameter(Mandatory=$False, HelpMessage='Use share read/write mode on errors. Can help if file is open in share read/write mode. Possible values: $true/$false', ParameterSetName='FileLevel')] + [Nullable[boolean]] + $UseShareReadWriteModeOnError, + # + [Parameter(Mandatory=$False, HelpMessage='Backup empty folders. Possible values: $true/$false', ParameterSetName='FileLevel')] + [Nullable[boolean]] + $BackupEmptyFolders, + # + [Parameter(Mandatory=$False, HelpMessage="Backup files only after specific date. Example: ""06/09/19 7:43 AM""", ParameterSetName='FileLevel')] + [Alias("oa")] + [string] + $BackupOnlyAfter, + # + [Parameter(Mandatory=$False, HelpMessage='Exclude system and hidden files and folders. Possible values: $true/$false', ParameterSetName='FileLevel')] + [Alias("es")] + [Nullable[boolean]] + $ExcludeSystemHiddenFiles, + # + [Parameter(Mandatory=$False, HelpMessage="Skip folders with specified names (recursively). Example: -SkipFolders ""bin"",""*temp*"",""My*""", ParameterSetName='FileLevel')] + [string[]] + $SkipFolders, + # + [Parameter(Mandatory=$False, HelpMessage="Select files by mask to include in the backup plan. Example: -ifm ""*.doc"",""*.xls""", ParameterSetName='FileLevel')] + [string[]] + $IncludeFilesMask, + # + [Parameter(Mandatory=$False, HelpMessage="Select files by mask to exclude from the backup plan. Example: -efm ""*.bak"",""*.tmp""", ParameterSetName='FileLevel')] + [string[]] + $ExcludeFilesMask, + # + [Parameter(Mandatory=$False, HelpMessage='Ignore path not found errors. Possible values: $true/$false', ParameterSetName='FileLevel')] + [Alias("iepnf")] + [Nullable[boolean]] + $IgnoreErrorPathNotFound, + # + [Parameter(Mandatory=$False, HelpMessage="Add a new file to backup plan", ParameterSetName='FileLevel')] + [string[]] + $AddNewFile, + # + [Parameter(Mandatory=$False, HelpMessage="Add a new directory to backup plan", ParameterSetName='FileLevel')] + [string[]] + $AddNewDirectory, + # + [Parameter(Mandatory=$False, HelpMessage="Exclude a file from backup plan", ParameterSetName='FileLevel')] + [string[]] + $ExcludeFile, + # + [Parameter(Mandatory=$False, HelpMessage="Exclude a directory from backup plan", ParameterSetName='FileLevel')] + [string[]] + $ExcludeDirectory, + # + [Parameter(Mandatory=$False, HelpMessage="Specify files to backup", ParameterSetName='FileLevel')] + [string[]] + $BackupFile, + # + [Parameter(Mandatory=$False, HelpMessage="Specify directories to backup", ParameterSetName='FileLevel')] + [string[]] + $BackupDirectory, + # + [Parameter(Mandatory=$False, HelpMessage='Specify to generate detailed report. Possible values: $true/$false', ParameterSetName='FileLevel')] + [Nullable[boolean]] + $GenerateDetailedReport, + # ------------------------- Image-Based -------------------------------------- + [Parameter(Mandatory=$False, HelpMessage="Type of volumes to backup. Possible values: AllVolumes, FixedVolumes, SystemRequired, SelectedVolumes", ParameterSetName='ImageBased')] + [ValidateSet("AllVolumes", "FixedVolumes", "SystemRequired", "SelectedVolumes")] + [string] + $BackupVolumes, + # + [Parameter(Mandatory=$False, HelpMessage="Backup selected volumes with the specified IDs. Example: -Volumes ((Get-MBSDiskVolume).Volumes | Where {`$_.RequiredBySystem -eq `$true}).WindowsVolumeIdentity", ParameterSetName='ImageBased')] + [string[]] + $Volumes, + # + [Parameter(Mandatory=$False, HelpMessage='Disable VSS, use direct access to NTFS volume. Possible values: $true/$false', ParameterSetName='ImageBased')] + [Nullable[boolean]] + $disableVSS, + # + [Parameter(Mandatory=$False, HelpMessage='Enable or disable KeepBitLocker option for all partitions. Possible values: $true/$false', ParameterSetName='ImageBased')] + [Nullable[boolean]] + $KeepBitLocker, + # + [Parameter(Mandatory=$False, HelpMessage='Ignore bad sectors. Possible values: $true/$false', ParameterSetName='ImageBased')] + [Nullable[boolean]] + $ignoreBadSectors, + # + [Parameter(Mandatory=$False, HelpMessage='Use system VSS provider. Possible values: $true/$false', ParameterSetName='ImageBased')] + [Nullable[boolean]] + $useSystemVSS, + # + [Parameter(Mandatory=$False, HelpMessage="Prefetch block count (0 - 100, 0 without prefetch)", ParameterSetName='ImageBased')] + [Int32][ValidateRange(0,100)] + $prefetchBlockCount, + # + [Parameter(Mandatory=$False, HelpMessage="Block size. Possible values: 128, 256, 512, 1024", ParameterSetName='ImageBased')] + [ValidateSet("128", "256", "512", "1024")] + [string] + $blockSize, + # + [Parameter(Mandatory=$False, HelpMessage="Exclude files/folders from Image-Based backup plan", ParameterSetName='ImageBased')] + [string[]] + $ExcludeItem, + # + [Parameter(Mandatory=$False, HelpMessage="Disable the 'Exclude files/folders' option in Image-Based backup plan", ParameterSetName='ImageBased')] + [switch] + $DisableExcludeFilesFolders, + # + [Parameter(Mandatory=$False, HelpMessage="Enable KeepBitLocker option for volumes with specified IDs", ParameterSetName='ImageBased')] + [string[]] + $KeepBitLockerEnableForVolume, + # + [Parameter(Mandatory=$False, HelpMessage="Disable KeepBitLocker option for volumes with specified IDs", ParameterSetName='ImageBased')] + [string[]] + $KeepBitLockerDisableForVolume, + # + [Parameter(Mandatory=$False, HelpMessage='Run restore verification mode. Possible values: DoNotRun, RunForFull, RunForIncremental, RunForFullAndIncremental', ParameterSetName='ImageBased')] + [Nullable[MBS.Agent.Plan.RestoreVerificationMode]] + $RestoreVerificationMode + ) + + + + begin { + if (-not($CBB = Get-MBSAgent)) { + Break + } + if (-not($CBB.CBBProgramData)) { + Write-Error "ERROR: ""enginesettings.list"" not found" + Break + } + $CBBVersion = [version]$CBB.version + if ($CBBVersion -lt [System.version]"7.1.0.0") { + Write-Error "Version $($CBB.version) is not supported. Please upgrade to the minimum supported version 7.1" + Break + } + if (-Not(Test-MBSAgentMasterPassword)) { + $MasterPassword = $null + } else { + if (-Not(Test-MBSAgentMasterPassword -CheckMasterPassword -MasterPassword $MasterPassword)) { + $MasterPassword = Read-Host -AsSecureString -Prompt "Master Password" + if (-Not(Test-MBSAgentMasterPassword -CheckMasterPassword -MasterPassword $MasterPassword)) { + Write-Error "ERROR: Master password is not specified" + Break + } + } + } + + if ((($null -ne $ForeverForwardIncremental) -Or ($null -ne $IntelligentRetention)) -And (($null -ne $GFSKeepWeekly) -Or ($null -ne $GFSKeepMonthly) -Or ($null -ne $GFSKeepYearly) -Or ($null -ne $GFSMonthOfTheYear))) { + Write-Error "Forever Forward Incremental and GFS settings cannot be used at the same time" + Break + } + } + + process { + function Set-Arguments { + if ($StorageAccountID){$Argument += " -aid $StorageAccountID"} + if ($NewName){$Argument += " -nn ""$NewName"""} + if ($null -ne $SyncBeforeRun){ + if ($SyncBeforeRun) { + $Argument += " -sync yes" + }else{ + $Argument += " -sync no" + } + } + if(-Not ($Global:MSP360ModuleSettings.SkipCompression)) { + if ($null -ne $Compression){ + if ($Compression) { + $Argument += " -c yes" + }else{ + $Argument += " -c no" + } + } + } else { + Write-Warning "MSP360ModuleSettings.SkipCompression is set. Ignoring Compression option" + } + if ($DisableEncryption){$Argument += " -ed"} + if ($DisableSchedule){ + $Argument += " -sd" + if (-Not ($DisableForceFullSchedule)){$Argument += " -sdForce"} + } + if(-Not ($Global:MSP360ModuleSettings.SkipSSE)) { + if ($null -ne $ServerSideEncryption){ + if ($ServerSideEncryption) { + $Argument += " -sse yes" + }else{ + $Argument += " -sse no" + } + } + } else { + Write-Warning "MSP360ModuleSettings.SkipSSE is set. Ignoring ServerSideEncryption option" + } + if(-Not ($Global:MSP360ModuleSettings.SkipEncryption)) { + if ($EncryptionAlgorithm){$Argument += " -ea $EncryptionAlgorithm"} + if ($EncryptionPassword){$Argument += " -ep """+([System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($EncryptionPassword)))+""""} + } else { + Write-Warning "MSP360ModuleSettings.SkipEncryption is set. Ignoring EncryptionPassword and EncryptionAlgorithm options" + } + if(-Not ($Global:MSP360ModuleSettings.SkipStorageClass)) { + if ($StorageClass){$Argument += " -sc $StorageClass"} + } else { + Write-Warning "MSP360ModuleSettings.SkipStorageClass is set. Ignoring StorageClass option" + } + if ($null -ne $FullConsistencyCheck){ + if ($FullConsistencyCheck) { + $Argument += " -fcCheck yes" + }else{ + $Argument += " -fcCheck no" + } + } + # + if($Null -ne $ForeverForwardIncremental) { + if ($CBBVersion -ge [version]"7.8.0") { + if ($ForeverForwardIncremental) { + if (($BackupPlanStorageAccount.SGCloudTypeValue -eq "PhysicalFile") -Or ($BackupPlanStorageAccount.Type -eq "FileSystemConnection")) { + Write-Warning "Forever Forward Incremental cannot be enabled for file system storage destinations. Ignoring ForeverForwardIncremental option" + } else { + if ($RecurringType -And $At) { + if ($Null -ne $KeepVersionPeriod) { + $Argument += " -ffi yes" + } elseif ($BackupPlan.SerializationSupportRetentionTime -ne "10675199.02:48:05.4775807") { + $KeepVersionPeriodFromPlan = ([timespan]$BackupPlan.SerializationSupportRetentionTime).TotalDays + Write-Warning """KeepKeepVersionPeriod"" parameter not specified while enabling Forever Forward Incremental. Existing renetion policy setting (keep backup for $KeepVersionPeriodFromPlan days) will be used" + $Argument += " -ffi yes -purge $($KeepVersionPeriodFromPlan)d" + } else { + Write-Warning """KeepKeepVersionPeriod"" parameter not specified and no retention policy specified in the current plan while enabling Forever Forward Incremental. Ignoring ForeverForwardIncremental option" + } + } else { + Write-Warning "Schedule settings not specified while enabling Forever Forward Incremental. Ignoring ForeverForwardIncremental option" + } + } + } else { + $Argument += " -ffi no" + if ($BackupPlan.Schedule.Enabled) { + Write-Warning "The schedule settings will be set to ""No schedule"" while disabling Forever Forward Incremental" + } + if ($BackupPlan.ForceFullSchedule.Enabled) { + if (-Not ($DisableForceFullSchedule)){$Argument += " -sdForce"} + } + } + } else { + Write-Warning "Backup agent version is $CBBVersion. ""ForeverForwardIncremental"" parameter requires version 7.8.0 or higher. Ignoring ForeverForwardIncremental option" + } + } + + if($Null -ne $IntelligentRetention) { + if ($CBBVersion -ge [version]"7.8.0") { + if ($IntelligentRetention) { + if (-Not($ForeverForwardIncremental -eq $False)) { + $Argument += " -ir yes" + } else { + Write-Warning """ForeverForwardIncremental"" parameter is set to False. Intelligent retention cannot be enabled without Forever Forward Incremental" + } + } else { + $Argument += " -ir no" + } + } else { + Write-Warning "Backup agent version is $CBBVersion. ""IntelligentRetention"" parameter requires version 7.8.0 or higher. Ignoring IntelligentRetention option" + } + } + # + if($Null -ne $KeepVersionPeriod){ + if($KeepVersionPeriod -gt 0){ + $Argument += " -purge $($KeepVersionPeriod)d" + }else{ + $Argument += " -purge no" + } + } + + if($Null -ne $GFSKeepWeekly){ + if($GFSKeepWeekly -gt 0){ + $Argument += " -gfsW $($GFSKeepWeekly)" + }else{ + $Argument += " -gfsWDisable" + } + } + if($Null -ne $GFSKeepMonthly){ + if($GFSKeepMonthly -gt 0){ + $Argument += " -gfsM $($GFSKeepMonthly)" + }else{ + $Argument += " -gfsMDisable" + } + } + if($Null -ne $GFSKeepYearly){ + if($GFSKeepYearly -gt 0){ + $Argument += " -gfsY $($GFSKeepYearly)" + }else{ + $Argument += " -gfsYDisable" + } + } + if($GFSMonthOfTheYear -gt 0){$Argument += " -gfsYMonth $($GFSMonthOfTheYear)"} + + # + if ($RecurringType){ + if ($RecurringType -eq "day") { + $Argument += " -every day" + $Weekday = "su,mo,tu,we,th,fr,sa" + } elseif ($RecurringType -eq "week") { + $Argument += " -every day" + if ([string]::IsNullOrEmpty($Weekday)) { + Write-Warning "Parameter ""WeekDay"" not specified for weekly schedule. Setting schedule recurring type to daily" + } + } else { + $Argument += " -every $RecurringType" + } + } + if ($At){$Argument += " -at $At"} + if ($DayOfMonth){$Argument += " -day $DayOfMonth"} + if ($Weekday){$Argument += " -weekday "+($Weekday -join ",")} + if ($Weeknumber){$Argument += " -weeknumber $Weeknumber"} + if ($DailyFrom){$Argument += " -dailyFrom $DailyFrom"} + if ($DailyTill){$Argument += " -dailyTill $DailyTill"} + if ($Occurs){$Argument += " -occurs $Occurs"} + if ($OccurValue){$Argument += " -occurValue $OccurValue"} + if ($RepeatEvery){$Argument += " -repeatEvery $RepeatEvery"} + if ($repeatStartDate){$Argument += " -repeatStartDate $repeatStartDate"} + if ($stopAfter){$Argument += " -stopAfter $stopAfter"} + + if ($null -ne $preActionEnabled) { + if ($CBBVersion -ge [version]"6.3.8") { + if ($preActionEnabled) { + $Argument += " -prae yes" + } else { + $Argument += " -prae no" + } + } else { + Write-Warning "Backup agent version is $CBBVersion. ""preActionEnabled"" parameter requires version 6.3.8 or higher. Ignoring preActionEnabled option" + } + } + if ($preActionCommand){ + $Argument += " -preAction ""$preActionCommand""" + if (($CBBVersion -ge [version]"6.3.8") -And ($null -eq $preActionEnabled)) { + Write-Verbose -Message "$($PSCmdlet.MyInvocation.MyCommand.Name): -preActionCommand specified but -preActionEnabled is not set. Enabling pre action" + $Argument += " -prae yes" + } + } + if ($null -ne $preActionContinueAnyway){ + if ($preActionContinueAnyway) { + $Argument += " -pac yes" + }else{ + $Argument += " -pac no" + } + } + + if ($null -ne $postActionEnabled) { + if ($CBBVersion -ge [version]"6.3.8") { + if ($postActionEnabled) { + $Argument += " -ppae yes" + } else { + $Argument += " -ppae no" + } + } else { + Write-Warning "Backup agent version is $CBBVersion. ""postActionEnabled"" parameter requires version 6.3.8 or higher. Ignoring postActionEnabled option" + } + } + if ($postActionCommand){ + $Argument += " -postAction ""$postActionCommand""" + if (($CBBVersion -ge [version]"6.3.8") -And ($null -eq $postActionEnabled)) { + Write-Verbose -Message "$($PSCmdlet.MyInvocation.MyCommand.Name): -postActionCommand specified but -postActionEnabled is not set. Enabling post action" + $Argument += " -ppae yes" + } + } + if ($null -ne $postActionRunAnyway){ + if ($postActionRunAnyway) { + $Argument += " -paa yes" + }else{ + $Argument += " -paa no" + } + } + + # Need a fix in backup agent CLI for this option to work + #if ($DisableBackupChain) { + # if ($CBBVersion -ge [version]"7.2.1.0") { + # $Argument += " -chanPlanOff" + # }else{ + # Write-Verbose "$($PSCmdlet.MyInvocation.MyCommand.Name): Backup agent version is $CBBVersion. Using CBB import method for ""DisableBackupChain"" option" + # } + #} + + $BackupChainPlanIDIsPresent = $false + if ($BackupChainPlanID) { + if ($CBBVersion -ge [version]"7.2.1.0") { + $Argument += " -chainPlanOn $BackupChainPlanID" + $BackupChainPlanIDIsPresent = $true + }else{ + Write-Verbose "$($PSCmdlet.MyInvocation.MyCommand.Name): Backup agent version is $CBBVersion. Using CBB import method for ""BackupChainPlanID"" option" + } + } elseif (($BackupPlan.ExecuteNextPlan) -And (-Not ($DisableBackupChain))) { + if ($CBBVersion -ge [version]"7.2.1.0") { + $BackupChainPlanIDFromPlan = $BackupPlan.NextExectutionPlan + $BackupChainPlanIDIsPresent = $true + # Need a fix in backup agent CLI to avoid always re-enabling backup chain + #if (($null -ne $BackupChainExecuteOnlyAfterSuccess) -Or ($null -ne $BackupChainExecuteForceFull)) { + $Argument += " -chainPlanOn $BackupChainPlanIDFromPlan" + #} + } + } + + if (($null -ne $BackupChainExecuteOnlyAfterSuccess) -And (-Not ($DisableBackupChain))) { + if ($CBBVersion -ge [version]"7.2.1.0") { + if ($BackupChainPlanIDIsPresent) { + if ($BackupChainPlanIDFromPlan) { + Write-Verbose "$($PSCmdlet.MyInvocation.MyCommand.Name): ""BackupChainPlanID"" parameter not specified with ""BackupChainExecuteOnlyAfterSuccess"" option. Existing plan ID ($BackupChainPlanIDFromPlan) will be used" + } + if ($BackupChainExecuteOnlyAfterSuccess) { + $Argument += " -chainPlanAfterSuccess yes" + }else{ + $Argument += " -chainPlanAfterSuccess no" + } + }else{ + Write-Warning """BackupChainPlanID"" parameter not specified and backup chain is not enabled in the current plan. Ignoring ""BackupChainExecuteOnlyAfterSuccess"" option" + } + }else{ + Write-Verbose "$($PSCmdlet.MyInvocation.MyCommand.Name): Backup agent version is $CBBVersion. Using CBB import method for ""BackupChainExecuteOnlyAfterSuccess"" option" + } + } + if (($null -ne $BackupChainExecuteForceFull) -And (-Not ($DisableBackupChain))) { + if ($CBBVersion -ge [version]"7.2.1.0") { + if ($BackupChainPlanIDIsPresent) { + if ($BackupChainPlanIDFromPlan) { + Write-Verbose "$($PSCmdlet.MyInvocation.MyCommand.Name): ""BackupChainPlanID"" parameter not specified with ""BackupChainExecuteForceFull"" option. Existing plan ID ($BackupChainPlanIDFromPlan) will be used" + } + if ($BackupChainExecuteForceFull) { + $Argument += " -chainPlanForceFull yes" + }else{ + $Argument += " -chainPlanForceFull no" + } + }else{ + Write-Warning """BackupChainPlanID"" parameter not specified and backup chain is not enabled in the current plan. Ignoring ""BackupChainExecuteForceFull"" option" + } + }else{ + Write-Verbose "$($PSCmdlet.MyInvocation.MyCommand.Name): Backup agent version is $CBBVersion. Using CBB import method for ""BackupChainExecuteForceFull"" option" + } + } + + if ($notification){$Argument += " -notification $notification"} + if ($winLog){$Argument += " -winLog $winLog"} + + if ($null -ne $runMissed){ + if ($runMissed) { + $Argument += " -runMissed yes" + }else{ + $Argument += " -runMissed no" + } + } + + if (($ForeverForwardIncremental) -And ($RecurringTypeForceFull -Or $DayOfMonthForceFull -Or $weekdayForceFull -Or $repeatEveryForceFull -Or $repeatStartDateForceFull)) { + Write-Warning "Full schedule settings are not used when Forever Forward Incremental is enabled. Skipping full schedule parameters" + } else { + if ($RecurringTypeForceFull){ + if ($RecurringTypeForceFull -eq "day") { + $Argument += " -everyForceFull day" + $weekdayForceFull = "su,mo,tu,we,th,fr,sa" + } elseif ($RecurringTypeForceFull -eq "week") { + $Argument += " -everyForceFull day" + if ([string]::IsNullOrEmpty($weekdayForceFull)) { + Write-Warning "Parameter ""weekdayForceFull"" not specified for weekly full schedule. Setting full schedule recurring type to daily" + } + } else { + $Argument += " -everyForceFull $RecurringTypeForceFull" + } + } + if ($DayOfMonthForceFull){$Argument += " -dayForceFull $DayOfMonthForceFull"} + if ($weekdayForceFull){$Argument += " -weekdayForceFull $weekdayForceFull"} + if ($repeatEveryForceFull){$Argument += " -repeatEveryForceFull $repeatEveryForceFull"} + if ($repeatStartDateForceFull){$Argument += " -repeatStartDateForceFull $repeatStartDateForceFull"} + #if ($rebackupDate){$Argument += " -rebackupDate $rebackupDate"} + } + if ($DisableForceFullSchedule){$Argument += " -sdForce"} + + if ($null -ne $SyntheticFull){ + if ($SyntheticFull) { + $Argument += " -syntheticFull yes" + }else{ + $Argument += " -syntheticFull no" + } + } + + # --------- File-Level ------------ + if ($null -ne $UseFastNTFSScan){ + if ($CBBVersion -ge [version]"7.1.0.0") { + if ($UseFastNTFSScan) { + $Argument += " -fastNtfs yes" + }else{ + $Argument += " -fastNtfs no" + } + } else { + Write-Warning "Backup agent version is $CBBVersion. ""UseFastNTFSScan"" parameter requires version 7.1.0 or higher. Ignoring UseFastNTFSScan option" + } + } + if ($null -ne $BackupNTFSPermissions){ + if ($BackupNTFSPermissions) { + $Argument += " -ntfs yes" + }else{ + $Argument += " -ntfs no" + } + } + if(-Not ($Global:MSP360ModuleSettings.SkipVSS)) { + if ($null -ne $ForceUsingVSS){ + if ($ForceUsingVSS) { + $Argument += " -vss yes" + }else{ + if ($UseFastNTFSScan) { + Write-Warning "Cannot disable ForceUsingVSS because UseFastNTFSScan is enabled" + } else { + $Argument += " -vss no" + } + } + } + } else { + Write-Warning "MSP360ModuleSettings.SkipVSS is set. Ignoring ForceUsingVSS option" + } + if ($null -ne $KeepEFSEncryption){ + if ($CBBVersion -ge [version]"7.6.0.70") { + if ($KeepEFSEncryption) { + $Argument += " -keepEfsEncryption yes" + }else{ + $Argument += " -keepEfsEncryption no" + } + } else { + Write-Warning "Backup agent version is $CBBVersion. ""KeepEFSEncryption"" parameter requires version 7.6.0 or higher. Ignoring KeepEFSEncryption option" + } + } + if ($null -ne $UseShareReadWriteModeOnError){ + if ($UseShareReadWriteModeOnError) { + $Argument += " -sharerw yes" + }else{ + $Argument += " -sharerw no" + } + } + if ($null -ne $BackupEmptyFolders){ + if ($BackupEmptyFolders) { + $Argument += " -bef yes" + }else{ + $Argument += " -bef no" + } + } + if ($BackupOnlyAfter){$Argument += " -oa $BackupOnlyAfter"} + if ($null -ne $ExcludeSystemHiddenFiles){ + if ($ExcludeSystemHiddenFiles) { + $Argument += " -es yes" + }else{ + $Argument += " -es no" + } + } + if ($SkipFolders){$Argument += " -skipf "+'"{0}"' -f ($SkipFolders -join ';')} + if ($IncludeFilesMask){$Argument += " -ifm "+'"{0}"' -f ($IncludeFilesMask -join ';')} + if ($ExcludeFilesMask){$Argument += " -efm "+'"{0}"' -f ($ExcludeFilesMask -join ';')} + if ($null -ne $IgnoreErrorPathNotFound){ + if ($IgnoreErrorPathNotFound) { + $Argument += " -iepnf yes" + }else{ + $Argument += " -iepnf no" + } + } + if ($AddNewFile){$Argument += " -af "+'"{0}"' -f ($AddNewFile -join '" -af "')} + if ($AddNewDirectory){$Argument += " -ad "+'"{0}"' -f ($AddNewDirectory -join '" -ad "')} + if ($ExcludeFile){$Argument += " -rf "+'"{0}"' -f ($ExcludeFile -join '" -rf "')} + if ($ExcludeDirectory){$Argument += " -rd "+'"{0}"' -f ($ExcludeDirectory -join '" -rd "')} + if ($BackupFile){$Argument += " -f "+'"{0}"' -f ($BackupFile -join '" -f "')} + if ($BackupDirectory){$Argument += " -d "+'"{0}"' -f ($BackupDirectory -join '" -d "')} + if ($null -ne $GenerateDetailedReport){ + if ($GenerateDetailedReport) { + $Argument += " -dr yes" + }else{ + $Argument += " -dr no" + } + } + + # ------------- Image-Based ------------- + + switch ($BackupVolumes) { + 'AllVolumes' {$Argument += " -av"} + 'FixedVolumes' { + if ($CBBVersion -ge [version]"7.2.2.10") { + $Argument += " -f" + } else { + Write-Warning "Backup agent version is $CBBVersion. ""FixedVolumes"" backup volume type requires version 7.2.2 or higher. Setting SystemRequired value" + $Argument += " -r" + } + } + 'SystemRequired' {$Argument += " -r"} + 'SelectedVolumes' { + ForEach-Object -InputObject $Volumes -Process { + $Argument += " -v $_" + } + } + Default {} + } + + if ($null -ne $disableVSS){ + if ($disableVSS) { + $Argument += " -disableVSS yes" + }else{ + $Argument += " -disableVSS no" + } + } + if ($null -ne $ignoreBadSectors){ + if ($ignoreBadSectors) { + $Argument += " -ignoreBadSectors yes" + }else{ + $Argument += " -ignoreBadSectors no" + } + } + if ($null -ne $useSystemVSS){ + if ($useSystemVSS) { + $Argument += " -useSystemVSS yes" + }else{ + $Argument += " -useSystemVSS no" + } + } + if ($prefetchBlockCount){$Argument += " -prefetchBlockCount $prefetchBlockCount"} + if ($blockSize){$Argument += " -blockSize $blockSize"} + if ($ExcludeItem) { + if ($CBBVersion -ge [version]"7.8.2") { + $Argument += " -skipf "+'"{0}"' -f ($ExcludeItem -join '" -skipf "') + }else{ + Write-Verbose "$($PSCmdlet.MyInvocation.MyCommand.Name): Backup agent version is $CBBVersion. Using CBB import method for ""ExcludeItem"" option" + } + } + if ($DisableExcludeFilesFolders){ + if ($CBBVersion -ge [version]"7.8.2") { + $Argument += " -skipfoff" + }else{ + Write-Verbose "$($PSCmdlet.MyInvocation.MyCommand.Name): Backup agent version is $CBBVersion. Using CBB import method for ""DisableExcludeFilesFolders"" option" + } + } + if ($null -ne $KeepBitLocker) { + if ($CBBVersion -ge [version]"7.2.2.0") { + if ($KeepBitLocker) { + $Argument += " -keepBitlocker yes" + }else{ + $Argument += " -keepBitlocker no" + } + }else{ + Write-Verbose "$($PSCmdlet.MyInvocation.MyCommand.Name): Backup agent version is $CBBVersion. Using CBB import method for ""KeepBitLocker"" option" + } + } + if ($KeepBitLockerEnableForVolume) { + if ($CBBVersion -ge [version]"7.2.2.0") { + if ($null -eq $KeepBitLocker) { + $Argument += " -keepBitlockerOn "+'"{0}"' -f ($KeepBitLockerEnableForVolume -join '" -keepBitlockerOn "') + } else { + Write-Warning """KeepBitLocker"" and ""KeepBitLockerEnableForVolume"" parameters are mutually exclusive. Ignoring KeepBitLockerEnableForVolume option" + } + }else{ + Write-Warning "Backup agent version is $CBBVersion. ""KeepBitLockerEnableForVolume"" parameter requires version 7.2.2 or higher. Ignoring KeepBitLockerEnableForVolume option" + } + } + if ($KeepBitLockerDisableForVolume) { + if ($CBBVersion -ge [version]"7.2.2.0") { + if ($null -eq $KeepBitLocker) { + $Argument += " -keepBitlockerOff "+'"{0}"' -f ($KeepBitLockerDisableForVolume -join '" -keepBitlockerOff "') + } else { + Write-Warning """KeepBitLocker"" and ""KeepBitLockerDisableForVolume"" parameters are mutually exclusive. Ignoring KeepBitLockerDisableForVolume option" + } + }else{ + Write-Warning "Backup agent version is $CBBVersion. ""KeepBitLockerDisableForVolume"" parameter requires version 7.2.2 or higher. Ignoring KeepBitLockerDisableForVolume option" + } + } + + switch ($RestoreVerificationMode) { + 'DoNotRun' {$Argument += " -rv None"} + 'RunForFull' {$Argument += " -rv OnFull"} + 'RunForIncremental' {$Argument += " -rv OnDiff"} + 'RunForFullAndIncremental' {$Argument += " -rv OnAll"} + Default {} + } + + Return $Argument + } + + if ($_){ + $BackupPlanFromPipeline = $_ + #$ID = $BackupPlanFromPipeline.ID + $BackupPlan = Get-MBSBackupPlan -OutputType Raw | Where-Object {$_.ID -eq $BackupPlanFromPipeline.ID} + }else{ + if($ID){ + $BackupPlan = Get-MBSBackupPlan -OutputType Raw | Where-Object {$_.ID -eq $ID} + }else{ + $BackupPlan = Get-MBSBackupPlan -OutputType Raw | Where-Object {$_.Name -eq $Name} + } + } + + $BackupPlanStorageAccount = Get-MBSStorageAccount -ID $BackupPlan.ConnectionID + + if($BackupPlan){ + if (-Not ($BackupPlan.IsArchive)) { + Write-Host "Backup plan ""$($BackupPlan.Name)"" is not an NBF plan" -ForegroundColor Red + return + } + if(($BackupPlan.Type -eq "Plan") -and $FileLevel){ + $Arguments = " editBackupPlan" + }elseif (($BackupPlan.Type -eq "BackupDiskImagePlan") -and $ImageBased) { + $Arguments = " editBackupIBBPlan" + }elseif ($All) { + switch ($BackupPlan.Type) { + 'Plan' {$Arguments = " editBackupPlan"} + 'BackupDiskImagePlan' {$Arguments = " editBackupIBBPlan"} + Default { + Write-host """$($BackupPlan.Type)"" type is not supported by the Cmdlet" -ForegroundColor Red + return + } + } + }else{ + Write-host "Backup plan ""$($BackupPlan.Name)"" is skipped because the type of plan and parameter set do not match" -ForegroundColor Red + return + } + }else{ + Write-host "Backup plan with"$(if($ID){"ID ""$ID"""}else{"name ""$Name"""})"not found" -ForegroundColor Red + return + } + + if ($ID){ + $Arguments += " -id $ID" + }else{ + $Arguments += " -n ""$Name""" + } + $Arguments += Set-Arguments + if($Arguments -notmatch '^( editBackupPlan| editBackupIBBPlan) (-id [0-9A-Fa-f]{8}(?:-[0-9A-Fa-f]{4}){3}-[0-9A-Fa-f]{12}|-n "[^"]*")$'){ + (Start-MBSProcess -CMDPath $CBB.CBBCLIPath -CMDArguments $Arguments -Output short -MasterPassword $MasterPassword).result + #} else { + # Write-Host "No settings to apply for backup plan with"$(if($ID){"ID ""$ID"""}else{"name ""$Name"""}) + } + + if ((($BackupChainPlanID) -or ($null -ne $BackupChainExecuteOnlyAfterSuccess) -or ($null -ne $BackupChainExecuteForceFull)) -And ($CBBVersion -lt [version]"7.2.1.0")){ + $BackupPlanXml = [xml](Get-Content ($CBB.CBBProgramData+"\"+$BackupPlan.ID+".cbb")) + #if($DisableBackupChain){ + # $BackupPlanXml.BasePlan.ExecuteNextPlan = "false" + #}else{ + if ($BackupChainPlanID) { + $null = $BackupPlanXml.BasePlan.RemoveChild($BackupPlanXml.BasePlan.selectSingleNode("//NextExectutionPlan")) + $null = ($BackupPlanXml.selectSingleNode("//BasePlan")).AppendChild($BackupPlanXml.CreateElement("NextExectutionPlan")).AppendChild($BackupPlanXml.CreateTextNode("$BackupChainPlanID")) + $BackupPlanXml.BasePlan.ExecuteNextPlan = "true" + } + if ($null -ne $BackupChainExecuteOnlyAfterSuccess) { + $BackupPlanXml.BasePlan.ExecuteNextPlanOnlyIfSucces = $BackupChainExecuteOnlyAfterSuccess.ToString().ToLower() + } + if ($null -ne $BackupChainExecuteForceFull) { + $BackupPlanXml.BasePlan.ForceFullNextPlan = $BackupChainExecuteForceFull.ToString().ToLower() + } + #} + $Null = Import-Configuration -BackupPlanXml $BackupPlanXml -MasterPassword $MasterPassword + } + if ($DisableBackupChain) { + $BackupPlanXml = [xml](Get-Content ($CBB.CBBProgramData+"\"+$BackupPlan.ID+".cbb")) + $BackupPlanXml.BasePlan.ExecuteNextPlan = "false" + $Null = Import-Configuration -BackupPlanXml $BackupPlanXml -MasterPassword $MasterPassword + } + if (($ExcludeItem) -and ($CBBVersion -lt [version]"7.8.2")){ + $BackupPlanXml = [xml](Get-Content ($CBB.CBBProgramData+"\"+$BackupPlan.ID+".cbb")) + foreach ($ExcludePath in $ExcludeItem) { + $BackupPlanXml.BasePlan.DiskInfo.DiskInfoCommunication.Volumes.VolumeInfoCommunication | Where-Object {$_.MountPoints.string -eq $ExcludePath.Substring(0,3)} | ForEach-Object -Process { + if (-not ($_.BackupOptions.ExcludeRules.FileExcludeRule | Where-Object Folder -eq $ExcludePath.Remove(0,2))){ + $element = ($_.BackupOptions.SelectSingleNode(".//ExcludeRules")).AppendChild($BackupPlanXml.CreateElement("FileExcludeRule")) + $null = $element.AppendChild($BackupPlanXml.CreateElement("Folder")).AppendChild($BackupPlanXml.CreateTextNode($ExcludePath.Remove(0,2))) + $null = $element.AppendChild($BackupPlanXml.CreateElement("Mask")).AppendChild($BackupPlanXml.CreateTextNode("*")) + $null = $element.AppendChild($BackupPlanXml.CreateElement("Recursive")).AppendChild($BackupPlanXml.CreateTextNode("true")) + $null = $element.AppendChild($BackupPlanXml.CreateElement("DeleteFolder")).AppendChild($BackupPlanXml.CreateTextNode("true")) + } + } + } + $BackupPlanXml.BasePlan.ExcludeEnabled = "true" + Import-Configuration -BackupPlanXml $BackupPlanXml -MasterPassword $MasterPassword + }elseif (($DisableExcludeFilesFolders) -and ($CBBVersion -lt [version]"7.8.2")){ + $BackupPlanXml = [xml](Get-Content ($CBB.CBBProgramData+"\"+$BackupPlan.ID+".cbb")) + $BackupPlanXml.SelectNodes("BasePlan/DiskInfo/DiskInfoCommunication/Volumes/VolumeInfoCommunication/BackupOptions/ExcludeRules") | ForEach-Object { + #$_.RemoveAll() + $_.IsEmpty = $true + } + $BackupPlanXml.BasePlan.ExcludeEnabled = "false" + Import-Configuration -BackupPlanXml $BackupPlanXml -MasterPassword $MasterPassword + } + if (($null -ne $KeepBitLocker) -and ($CBBVersion -lt [version]"7.2.2.0")){ + $BackupPlanXml = [xml](Get-Content ($CBB.CBBProgramData+"\"+$BackupPlan.ID+".cbb")) + $BackupPlanXml.BasePlan.DiskInfo.DiskInfoCommunication.Volumes.VolumeInfoCommunication | ForEach-Object -Process { + $_.BackupOptions.KeepBitLocker = $KeepBitLocker.ToString().ToLower() + } + $Null = Import-Configuration -BackupPlanXml $BackupPlanXml -MasterPassword $MasterPassword + } + } + + end { + + } +} \ No newline at end of file diff --git a/public/cbb/Get-MBSBackupPlan.ps1 b/public/cbb/Get-MBSBackupPlan.ps1 index 08001c2d78785f34cb4a68da4a0ba3f0ecafedbb..0907d4ae15c8a57df5da453a9634bc5242500e85 100644 GIT binary patch delta 1289 zcmeHF-77<39DWuq6bY?eh|-7=`5JO#C);W%n@zcpa^m1ry9y2(zs6(2zv(cb<%X=Cu5>BC<3BtntoH!zca1GsiccQRhP|g@-&p=Yfh_ElpoE zMcii2eN{i;=X4}Em=s$A)l-@ioxmEWI>v#D*KM{K462lrwr^jdlIrPc6~9DDqC9kL zh@W(yw^O-)+^5JA>@c6o7@gTwiOV9)xHXwt4L+$a((aW!n#78-`T49-b9=Wrncuh7 zi@q?hj9zNKv(r;lYmomo56Ox4{&vPxBT-GZydBPU1$qngh ilLNf@HaEEaGubRw^GtyxJu2dx1&(@HZ;fJHW)A@F|1r`4 diff --git a/public/cbb/New-MBSBackupPlan.ps1 b/public/cbb/New-MBSBackupPlan.ps1 index 60285f5..6137356 100644 --- a/public/cbb/New-MBSBackupPlan.ps1 +++ b/public/cbb/New-MBSBackupPlan.ps1 @@ -242,6 +242,7 @@ function New-MBSBackupPlan { #---------------------------- Block Level ------------------ [Parameter(Mandatory=$False, HelpMessage='Use block level backup.', ParameterSetName='FileLevel')] + [Parameter(Mandatory=$False, HelpMessage='Use block level backup.', ParameterSetName='ImageBased')] [Switch] $UseBlockLevelBackup, @@ -497,8 +498,16 @@ function New-MBSBackupPlan { $Argument += " -aid ""$($StorageAccount.ID)""" } + if ($useBlockLevelBackup) {$Argument += " -useBlockLevelBackup yes"} + if($Schedule){$Argument += Set-Schedule -Schedule $Schedule} - if($FullSchedule){$Argument += Set-Schedule -Schedule $FullSchedule -Prefix "ForceFull"} + if($FullSchedule){ + if ((($PSCmdlet.ParameterSetName -eq 'FileLevel') -Or ($PSCmdlet.ParameterSetName -eq 'ImageBased')) -And (-Not ($useBlockLevelBackup))) { + Write-Warning "Full schedule options specified but ""useBlockLevelBackup"" parameter is not enabled. Enabling ""useBlockLevelBackup"" parameter..." + $Argument += " -useBlockLevelBackup yes" + } + $Argument += Set-Schedule -Schedule $FullSchedule -Prefix "ForceFull" + } if($MSSQLDiffSchedule){$Argument += Set-Schedule -Schedule $MSSQLDiffSchedule -Prefix "Diff"} if($MSSQLTlogSchedule){$Argument += Set-Schedule -Schedule $MSSQLTlogSchedule -Prefix "TLog"} @@ -544,11 +553,33 @@ function New-MBSBackupPlan { $Argument += " -paa no" } } + if ($BackupPlanCommonOption.BackupChainPlanID) { + if ($CBBVersion -ge [version]"7.2.1.0") { + $Argument += " -chainPlanOn $($BackupPlanCommonOption.BackupChainPlanID)" + if ($null -ne $BackupPlanCommonOption.BackupChainExecuteOnlyAfterSuccess) { + if ($BackupPlanCommonOption.BackupChainExecuteOnlyAfterSuccess) { + $Argument += " -chainPlanAfterSuccess yes" + }else{ + $Argument += " -chainPlanAfterSuccess no" + } + } + if ($null -ne $BackupPlanCommonOption.BackupChainExecuteForceFull) { + if ($BackupPlanCommonOption.BackupChainExecuteForceFull) { + $Argument += " -chainPlanForceFull yes" + }else{ + $Argument += " -chainPlanForceFull no" + } + } + }else{ + Write-Warning "Backup agent version is $CBBVersion. Backup chain parameters require version 7.2.1 or higher. Ignoring backup chain options" + } + } + if($Null -ne $BackupPlanCommonOption.ResultEmailNotification){$Argument += " -notification $($BackupPlanCommonOption.ResultEmailNotification)"} if($Null -ne $BackupPlanCommonOption.AddEventToWindowsLog){$Argument += " -winLog $($BackupPlanCommonOption.AddEventToWindowsLog)"} if($Null -ne $BackupPlanCommonOption.KeepVersionPeriod){ - if($BackupPlanCommonOption.KeepVersionPeriod.TotalDays -gt 0){ - $Argument += " -purge $([Math]::Round($BackupPlanCommonOption.KeepVersionPeriod.TotalDays))d" + if($BackupPlanCommonOption.KeepVersionPeriod -gt 0){ + $Argument += " -purge $($BackupPlanCommonOption.KeepVersionPeriod)d" }else{ $Argument += " -purge no" } @@ -560,10 +591,16 @@ function New-MBSBackupPlan { $Argument += " -keep all" } } - if($BackupPlanCommonOption.KeepLastVersion){$Argument += " -keepLastVersion yes"} + if($Null -ne $BackupPlanCommonOption.KeepLastVersion){ + if ($BackupPlanCommonOption.KeepLastVersion){ + $Argument += " -keepLastVersion yes" + }else{ + $Argument += " -keepLastVersion no" + } + } if($Null -ne $BackupPlanCommonOption.DelayPurgePeriod){ - if($BackupPlanCommonOption.DelayPurgePeriod.TotalDays -gt 0){ - $Argument += " -delayPurge $([Math]::Round($BackupPlanCommonOption.DelayPurgePeriod.TotalDays))d" + if($BackupPlanCommonOption.DelayPurgePeriod -gt 0){ + $Argument += " -delayPurge $($BackupPlanCommonOption.DelayPurgePeriod)d" }else{ $Argument += " -delayPurge no" } @@ -573,7 +610,6 @@ function New-MBSBackupPlan { 'FileLevel' { # --------- File-Level ------------ #$Argument += " addBackupPlan" - if ($useBlockLevelBackup) {$Argument += " -useBlockLevelBackup yes"} if ($UseFastNTFSScan) { if ($CBBVersion -ge [version]"7.1.0.0") { $Argument += " -fastNtfs yes" diff --git a/public/cbb/New-MBSBackupPlanCommonOption.ps1 b/public/cbb/New-MBSBackupPlanCommonOption.ps1 index 7b6c0ef..91c99d4 100644 --- a/public/cbb/New-MBSBackupPlanCommonOption.ps1 +++ b/public/cbb/New-MBSBackupPlanCommonOption.ps1 @@ -44,7 +44,16 @@ function New-MBSBackupPlanCommonOption { .PARAMETER PostActionRunAnyway Specify to execute post-backup action in any case (regardless the backup result). - + + .PARAMETER BackupChainPlanID + Specify chained plan ID. Use (Get-MBSBackupPlan | Where-Object Name -eq 'Backup plans name').ID or (Get-MBSRestorePlan | Where-Object Name -eq 'Backup plan name').ID + + .PARAMETER BackupChainExecuteOnlyAfterSuccess + Specify to execute the chained plan only if the current plan is completed successfully ($true) or always ($false) + + .PARAMETER BackupChainExecuteForceFull + Specify to force full backup for the chained plan + .PARAMETER ResultEmailNotification Specify to send backup plan result notification email when backup fails (errorOnly) or in all cases (on). Prior to turn on the notification settings must be configured. @@ -52,7 +61,7 @@ function New-MBSBackupPlanCommonOption { Specify to add entry to Windows Event Log when backup fails (errorOnly) or in all cases (on). .PARAMETER KeepVersionPeriod - Keep versions for specified number of days. Omit to use defult retention policy, set 0 to keep all versions or specify number of days. Example: -KeepVersionPeriod 180. . + Keep versions for specified number of days. Omit to use defult retention policy, set 0 to keep all versions or specify number of days. Example: -KeepVersionPeriod 180 .PARAMETER KeepNumberOfVersion Keep limited number of versions. Possible values: 0 to keep all version or specific number of versions @@ -61,7 +70,7 @@ function New-MBSBackupPlanCommonOption { Always keep the last version. .PARAMETER DelayPurgePeriod - Specify purge delay. Omit to use defult retention policy, set 0 to purge version withour delay or specify number of days. Example: -DelayPurgePeriod 180. . + Specify purge delay. Omit to use defult retention policy, set 0 to purge version withour delay or specify number of days. Example: -DelayPurgePeriod 180 .EXAMPLE $CommonOptions = New-MBSBackupPlanCommonOption -SyncRepositoryBeforeRun $true -UseServerSideEncryption $true -EncryptionAlgorithm AES256 -EncryptionPassword (ConvertTo-SecureString -string "My_Password" -AsPlainText -Force) -UseCompression $true -StorageClass OneZoneIA -SaveBackupPlanConfiguration $true -StopIfPlanRunsFor 10:00 @@ -139,6 +148,18 @@ function New-MBSBackupPlanCommonOption { [Nullable[boolean]] $PostActionRunAnyway, # + [Parameter(Mandatory=$False, HelpMessage="Specify chained plan ID. Use (Get-MBSBackupPlan | Where-Object Name -eq 'Backup plans name').ID or (Get-MBSRestorePlan | Where-Object Name -eq 'Backup plan name').ID")] + [string] + $BackupChainPlanID, + # + [Parameter(Mandatory=$False, HelpMessage='Specify to execute the chained plan only if the current plan is completed successfully ($true) or always ($false)')] + [Nullable[boolean]] + $BackupChainExecuteOnlyAfterSuccess, + # + [Parameter(Mandatory=$False, HelpMessage='Specify to force full backup for the chained plan. Possible values: $true/$false')] + [Nullable[boolean]] + $BackupChainExecuteForceFull, + # [Parameter(Mandatory=$False, HelpMessage="Specify to send backup plan result notification email when backup fails (errorOnly) or in all cases (on). Prior to turn on the notification settings must be configured. Possible values: errorOnly, on, off")] [MBS.Agent.Plan.Notification] $ResultEmailNotification = 'off', @@ -148,8 +169,8 @@ function New-MBSBackupPlanCommonOption { $AddEventToWindowsLog = 'off', # ---------------------------- Retention Policy ------------------------- # - [Parameter(Mandatory=$False, HelpMessage="Keep versions for specified number of days. Omit to use defult retention policy, set 0 to keep all versions or specify number of days. Example: -KeepVersionPeriod 180. ")] - [Nullable[Timespan]] + [Parameter(Mandatory=$False, HelpMessage="Keep versions for specified number of days. Omit to use defult retention policy, set 0 to keep all versions or specify number of days. Example: -KeepVersionPeriod 180")] + [Nullable[int]] $KeepVersionPeriod, # [Parameter(Mandatory=$False, HelpMessage="Keep limited number of versions. Possible values: 0 to keep all version or specific number of versions")] @@ -160,8 +181,8 @@ function New-MBSBackupPlanCommonOption { [boolean] $KeepLastVersion=$true, # - [Parameter(Mandatory=$False, HelpMessage="Specify purge delay. Omit to use defult retention policy, set 0 to purge version withour delay or specify number of days. Example: -DelayPurgePeriod 180. ")] - [Nullable[timespan]] + [Parameter(Mandatory=$False, HelpMessage="Specify purge delay. Omit to use defult retention policy, set 0 to purge version withour delay or specify number of days. Example: -DelayPurgePeriod 180")] + [Nullable[int]] $DelayPurgePeriod ) @@ -185,6 +206,9 @@ function New-MBSBackupPlanCommonOption { $BackupPlanOption.PreActionContinueAnyway = $PreActionContinueAnyway $BackupPlanOption.PostActionCommand = $PostActionCommand $BackupPlanOption.PostActionRunAnyway = $PostActionRunAnyway + $BackupPlanOption.BackupChainPlanID = $BackupChainPlanID + $BackupPlanOption.BackupChainExecuteOnlyAfterSuccess = $BackupChainExecuteOnlyAfterSuccess + $BackupPlanOption.BackupChainExecuteForceFull = $BackupChainExecuteForceFull $BackupPlanOption.ResultEmailNotification = $ResultEmailNotification $BackupPlanOption.AddEventToWindowsLog = $AddEventToWindowsLog if($null -ne $KeepVersionPeriod){$BackupPlanOption.KeepVersionPeriod = $KeepVersionPeriod} diff --git a/public/cbb/New-MBSNBFBackupPlanCommonOption.ps1 b/public/cbb/New-MBSNBFBackupPlanCommonOption.ps1 index d83e3ed..3127b7e 100644 --- a/public/cbb/New-MBSNBFBackupPlanCommonOption.ps1 +++ b/public/cbb/New-MBSNBFBackupPlanCommonOption.ps1 @@ -33,6 +33,9 @@ function New-MBSNBFBackupPlanCommonOption { .PARAMETER RunMissedPlanImmediately Run missed scheduled backup immediately when computer starts up. + .PARAMETER ForeverForwardIncremental + Enables Forever Forward Incremental backup + .PARAMETER PreActionCommand Specify command to be executed before backup completes @@ -44,7 +47,16 @@ function New-MBSNBFBackupPlanCommonOption { .PARAMETER PostActionRunAnyway Specify to execute post-backup action in any case (regardless the backup result). - + + .PARAMETER BackupChainPlanID + Specify chained plan ID. Use (Get-MBSBackupPlan | Where-Object Name -eq 'Backup plans name').ID or (Get-MBSRestorePlan | Where-Object Name -eq 'Backup plan name').ID + + .PARAMETER BackupChainExecuteOnlyAfterSuccess + Specify to execute the chained plan only if the current plan is completed successfully ($true) or always ($false) + + .PARAMETER BackupChainExecuteForceFull + Specify to force full backup for the chained plan + .PARAMETER ResultEmailNotification Specify to send backup plan result notification email when backup fails (errorOnly) or in all cases (on). Prior to turn on the notification settings must be configured. @@ -52,22 +64,25 @@ function New-MBSNBFBackupPlanCommonOption { Specify to add entry to Windows Event Log when backup fails (errorOnly) or in all cases (on). .PARAMETER KeepVersionPeriod - Keep versions for specified number of days. Omit to use defult retention policy, set 0 to keep all versions or specify number of days. Example: -KeepVersionPeriod 180. . + Keep versions for specified number of days. Omit to use defult retention policy, set 0 to keep all versions or specify number of days. Example: -KeepVersionPeriod 180 .PARAMETER GFSKeepWeekly - Enables GFS weekly storage type. Example: -KeepVersionPeriod 4. + Enables GFS weekly storage type. Example: -KeepVersionPeriod 4 .PARAMETER GFSKeepMonthly - Enables GFS monthly storage type. Example: -KeepVersionPeriod 12. + Enables GFS monthly storage type. Example: -KeepVersionPeriod 12 .PARAMETER GFSKeepYearly - Enables GFS yearly storage type. Example: -KeepVersionPeriod 5. + Enables GFS yearly storage type. Example: -KeepVersionPeriod 5 .PARAMETER GFSMonthOfTheYear - Specify the number of month for the first successful GFS full backup for yearly storage type. Example: -GFSMonthOfTheYear February + Specify the number of month for the first successful GFS full backup for yearly storage type. Example: -GFSMonthOfTheYear February + + .PARAMETER IntelligentRetention + Enables Intelligent Retention for Forever Forward Incremental .EXAMPLE - $CommonOptions = New-NBFBackupPlanCommonOption -SyncRepositoryBeforeRun $true -UseServerSideEncryption $true -EncryptionAlgorithm AES256 -EncryptionPassword (ConvertTo-SecureString -string "My_Password" -AsPlainText -Force) -UseCompression $true -StorageClass OneZoneIA -StopIfPlanRunsFor 10:00 + $CommonOptions = New-MBSNBFBackupPlanCommonOption -SyncRepositoryBeforeRun $true -UseServerSideEncryption $true -EncryptionAlgorithm AES256 -EncryptionPassword (ConvertTo-SecureString -string "My_Password" -AsPlainText -Force) -UseCompression $true -StorageClass OneZoneIA -StopIfPlanRunsFor 10:00 Create backup plan common options object. @@ -120,9 +135,13 @@ function New-MBSNBFBackupPlanCommonOption { [timespan] $StopIfPlanRunsFor='00:00', # - [Parameter(Mandatory=$False, HelpMessage='Run missed scheduled backup immediately when computer starts up. Possible values: $true/$false', ParameterSetName='Common')] + [Parameter(Mandatory=$False, HelpMessage='Run missed scheduled backup immediately when computer starts up. Possible values: $true/$false')] [boolean] $RunMissedPlanImmediately=$False, + # + [Parameter(Mandatory=$True, HelpMessage='Enables Forever Forward Incremental backup. Possible values: $true/$false', ParameterSetName='FFI')] + [boolean] + $ForeverForwardIncremental=$False, # ------------------ Pre / Post actions ---------------------------- [Parameter(Mandatory=$False, HelpMessage="Specify command to be executed before backup completes.")] [string] @@ -142,6 +161,18 @@ function New-MBSNBFBackupPlanCommonOption { [Nullable[boolean]] $PostActionRunAnyway, # + [Parameter(Mandatory=$False, HelpMessage="Specify chained plan ID. Use (Get-MBSBackupPlan | Where-Object Name -eq 'Backup plans name').ID or (Get-MBSRestorePlan | Where-Object Name -eq 'Backup plan name').ID")] + [string] + $BackupChainPlanID, + # + [Parameter(Mandatory=$False, HelpMessage='Specify to execute the chained plan only if the current plan is completed successfully ($true) or always ($false)')] + [Nullable[boolean]] + $BackupChainExecuteOnlyAfterSuccess, + # + [Parameter(Mandatory=$False, HelpMessage='Specify to force full backup for the chained plan. Possible values: $true/$false')] + [Nullable[boolean]] + $BackupChainExecuteForceFull, + # [Parameter(Mandatory=$False, HelpMessage="Specify to send backup plan result notification email when backup fails (errorOnly) or in all cases (on). Prior to turn on the notification settings must be configured. Possible values: errorOnly, on, off")] [MBS.Agent.Plan.Notification] $ResultEmailNotification = 'off', @@ -151,29 +182,33 @@ function New-MBSNBFBackupPlanCommonOption { $AddEventToWindowsLog = 'off', # ---------------------------- Retention Policy ------------------------- # - [Parameter(Mandatory=$False, HelpMessage="Keep versions for specified number of days. Omit to use defult retention policy, set 0 to keep all versions or specify number of days. Example: -KeepVersionPeriod 180. ")] - [Nullable[Timespan]] + [Parameter(Mandatory=$True, HelpMessage="Keep versions for specified number of days. Set 0 to keep all versions or specify number of days. Example: -KeepVersionPeriod 180", ParameterSetName='FFI')] + [Parameter(Mandatory=$False, HelpMessage="Keep versions for specified number of days. Set 0 to keep all versions or specify number of days. Example: -KeepVersionPeriod 180", ParameterSetName='GFS')] + [int] $KeepVersionPeriod, # - [Parameter(Mandatory=$False, HelpMessage="Enables GFS weekly storage type. Example: -KeepVersionPeriod 4")] + [Parameter(Mandatory=$False, HelpMessage="Enables GFS weekly storage type. Example: -KeepVersionPeriod 4", ParameterSetName='GFS')] [ValidateRange(0,100000)] [int] $GFSKeepWeekly = 0, # - [Parameter(Mandatory=$False, HelpMessage="Enables GFS monthly storage type. Example: -KeepVersionPeriod 12")] + [Parameter(Mandatory=$False, HelpMessage="Enables GFS monthly storage type. Example: -KeepVersionPeriod 12", ParameterSetName='GFS')] [ValidateRange(0,10000)] [int] $GFSKeepMonthly = 0, # - [Parameter(Mandatory=$False, HelpMessage="Enables GFS yearly storage type. Example: -KeepVersionPeriod 5")] + [Parameter(Mandatory=$False, HelpMessage="Enables GFS yearly storage type. Example: -KeepVersionPeriod 5", ParameterSetName='GFS')] [ValidateRange(0,1000)] [int] $GFSKeepYearly = 0, # - [Parameter(Mandatory=$False, HelpMessage="Specify the number of month for the first successful GFS full backup for yearly storage type. Example: -GFSMonthOfTheYear February ")] + [Parameter(Mandatory=$False, HelpMessage="Specify the number of month for the first successful GFS full backup for yearly storage type. Example: -GFSMonthOfTheYear February", ParameterSetName='GFS')] [MBS.Agent.Plan.Month] - $GFSMonthOfTheYear = "NotSet" - + $GFSMonthOfTheYear = "NotSet", + # + [Parameter(Mandatory=$False, HelpMessage='Enables Intelligent Retention for Forever Forward Incremental. Possible values: $true/$false. By default set to $true if Forever Forward Incremental is enabled', ParameterSetName='FFI')] + [boolean] + $IntelligentRetention=$True ) begin { @@ -191,10 +226,14 @@ function New-MBSNBFBackupPlanCommonOption { $BackupPlanOption.FullConsistencyCheck = $FullConsistencyCheck $BackupPlanOption.StopIfPlanRunsFor = $StopIfPlanRunsFor $BackupPlanOption.RunMissedPlanImmediately = $RunMissedPlanImmediately + $BackupPlanOption.ForeverForwardIncremental = $ForeverForwardIncremental $BackupPlanOption.PreActionCommand = $PreActionCommand $BackupPlanOption.PreActionContinueAnyway = $PreActionContinueAnyway $BackupPlanOption.PostActionCommand = $PostActionCommand $BackupPlanOption.PostActionRunAnyway = $PostActionRunAnyway + $BackupPlanOption.BackupChainPlanID = $BackupChainPlanID + $BackupPlanOption.BackupChainExecuteOnlyAfterSuccess = $BackupChainExecuteOnlyAfterSuccess + $BackupPlanOption.BackupChainExecuteForceFull = $BackupChainExecuteForceFull $BackupPlanOption.ResultEmailNotification = $ResultEmailNotification $BackupPlanOption.AddEventToWindowsLog = $AddEventToWindowsLog if($null -ne $KeepVersionPeriod){$BackupPlanOption.KeepVersionPeriod = $KeepVersionPeriod} @@ -202,6 +241,7 @@ function New-MBSNBFBackupPlanCommonOption { if($null -ne $GFSKeepMonthly){$BackupPlanOption.GFSKeepMonthly = $GFSKeepMonthly} if($null -ne $GFSKeepYearly){$BackupPlanOption.GFSKeepYearly = $GFSKeepYearly} $BackupPlanOption.GFSMonthOfTheYear = $GFSMonthOfTheYear + $BackupPlanOption.IntelligentRetention = $IntelligentRetention return $BackupPlanOption } diff --git a/public/cbb/New-MBSNBFFileBackupPlan.ps1 b/public/cbb/New-MBSNBFFileBackupPlan.ps1 index dbf435d..43f1b4b 100644 --- a/public/cbb/New-MBSNBFFileBackupPlan.ps1 +++ b/public/cbb/New-MBSNBFFileBackupPlan.ps1 @@ -127,6 +127,10 @@ function New-MBSNBFFileBackupPlan { [Switch] $ForceUsingVSS, # + [Parameter(Mandatory=$False, HelpMessage='Back up EFS files as encrypted.', ParameterSetName='FileLevel')] + [Switch] + $KeepEFSEncryption, + # [Parameter(Mandatory=$False, HelpMessage='Use share read/write mode on errors. Can help if file is open in share read/write mode.', ParameterSetName='FileLevel')] [Switch] $UseShareReadWriteModeOnError, @@ -175,7 +179,7 @@ function New-MBSNBFFileBackupPlan { [System.Collections.Generic.List[string]] $ExcludeItem, # - [Parameter(Mandatory=$False, HelpMessage='Specify to generate detailed report.', ParameterSetName='FileLevel')] + [Parameter(Mandatory=$False, HelpMessage='Specify to generate detailed report', ParameterSetName='FileLevel')] [Switch] $GenerateDetailedReport ) @@ -212,6 +216,7 @@ function New-MBSNBFFileBackupPlan { BackupNTFSPermissions = $BackupNTFSPermissions FastNTFSScan = $FastNTFSScan ForceUsingVSS = $ForceUsingVSS + KeepEFSEncryption = $KeepEFSEncryption UseShareReadWriteModeOnError = $UseShareReadWriteModeOnError BackupEmptyFolders = $BackupEmptyFolders BackupOnlyAfter = $BackupOnlyAfter