Quantcast
Channel: R&D Forums
Viewing all articles
Browse latest Browse all 9932

Veeam Backup for Microsoft 365 • [Feature Request] Job Design Templates and Job Design Automation

$
0
0
As we see more and more companies adopting a cloud-first strategy and the volume of data in Microsoft 365 continues to grow, having well-designed Veeam M365 backup jobs becomes increasingly important. I would appreciate more documentation and templates from Veeam to support daily administration.

At the moment, the solution often feels like a workaround—especially when addressing performance issues related to M365 SharePoint backups. For example, SharePoint data cannot be backed up successfully within a reasonable timeframe using a single job. Each time, we end up creating a custom solution for the specific case.


SVA Custom Script Version with Pattern Recognition:

# Version 15.04.2025

#@@ -0,0 +1,72 @@
<#
.NAME
Veeam Backup for Microsoft Office 365 Dynamic SP Jobs
.SYNOPSIS
Script to use for automatically adding SharePoint Sites to a backup job
.DESCRIPTION
Script to use for dynamically creating and adding SharePoint Sites to a backup job based upon the first letter of the site name
Schedule with task manager to run daily to capture new sites
Created for Veeam Backup for Microsoft Office 365 v4
Released under the MIT license.
.LINK

https://github.com/tsmithco

Customized and Extended by SVA David Hillen & Phillip Bley
#>

<#
.INSTRUCTIONS
Modify the repository name in the script to the desired target repository name.
Run the script daily via task scheduler.
#>


#Import the VBO PS module
Import-Module "C:\Program Files\Veeam\Backup365\Veeam.Archiver.PowerShell\Veeam.Archiver.PowerShell.psd1"

#connect to the organization (assuming 1 org)
$Org = Get-VBOOrganization


#Modify the target repository name below
$repo = Get-VBOrepository -name "REPO_NAME"

#Get all sites within the organization that are not personal SP sites, and that are not already in a backup job.
$Sites = Get-VBOOrganizationSite -org $org -IncludePersonalSite:$false -NotInJob


#Job name as a string and as integers so it can be incremented to the next letter
$SPjob=[int[]][char[]]'SP-A'
$letter=[char[]]$SPjob -join ""


$i=0
while ($i -lt 26){


#Filter set to anything that starts with the 4th character of the job name, "A" to begin with.
$filter = '^' + ([char[]]$SPjob[3])

ForEach ($Site in $Sites) {

#Pattern Recognition
if ($Site.Name -match "^[A-Z-]+-(.+)") {
$remaining = $matches[1]
Write-Output $remaining
}


$FilteredSite = $remaining -match "$Filter"

# Only add the sites if the filter is True
if ($FilteredSite) {
$newSite = New-VBOBackupItem -Site $Site

#Write-Output $Site.Name

#Attempt to create the backup job for the filtered letter if it doesn't exist.
try{
$job = Add-VBOJob -Organization $org -Name $letter -repo $repo -SelectedItems $newSite
}
#If the job exists, add the site to the existing job
catch{
$job = Get-VBOJob -name $letter
Write-Output Jobname: $job
Add-VBOBackupItem -Job $job -BackupItem $newSite
}
}
}

#Increment the job name's 4th character to the next letter.
$SPjob[-1]++
$letter=[char[]]$SPjob -join ""

$i++

}

$LastSites = Get-VBOOrganizationSite -org $org -IncludePersonalSite:$false -NotInJob

ForEach ($Site in $LastSites) {
$newSite = New-VBOBackupItem -Site $Site

#Write-Output $Site.Name

#Attempt to create the backup job for the filtered letter if it doesn't exist.
try{
$job = Add-VBOJob -Organization $org -Name "SP-Sammeljob" -repo $repo -SelectedItems $newSite
}
#If the job exists, add the site to the existing job
catch{
$job = Get-VBOJob -name "SP-Sammeljob"
Add-VBOBackupItem -Job $job -BackupItem $newSite
}
}


Vanilla Script form Github:

@@ -0,0 +1,72 @@
<#
.NAME
Veeam Backup for Microsoft Office 365 Dynamic SP Jobs
.SYNOPSIS
Script to use for automatically adding SharePoint Sites to a backup job
.DESCRIPTION
Script to use for dynamically creating and adding SharePoint Sites to a backup job based upon the first letter of the site name
Schedule with task manager to run daily to capture new sites
Created for Veeam Backup for Microsoft Office 365 v4
Released under the MIT license.
.LINK
https://github.com/tsmithco
#>

<#
.INSTRUCTIONS
Modify the repository name in the script to the desired target repository name.
Run the script daily via task scheduler.
#>


#Import the VBO PS module
Import-Module "C:\Program Files\Veeam\Backup365\Veeam.Archiver.PowerShell\Veeam.Archiver.PowerShell.psd1"

#connect to the organization (assuming 1 org)
$Org = Get-VBOOrganization


#Modify the target repository name below
$repo = Get-VBOrepository -name "REPO_NAME"

#Get all sites within the organization that are not personal SP sites, and that are not already in a backup job.
$Sites = Get-VBOOrganizationSite -org $org -IncludePersonalSite:$false -NotInJob


#Job name as a string and as integers so it can be incremented to the next letter
$SPjob=[int[]][char[]]'SP-A'
$letter=[char[]]$SPjob -join ""


$i=0
while ($i -lt 26){

#Filter set to anything that starts with the 3rd character of the job name, "A" to begin with.
$filter = '^' + ([char[]]$SPjob[3])

ForEach ($Site in $Sites) {
$FilteredSite = $Site.Name -match "$Filter"

# Only add the sites if the filter is True
if ($FilteredSite) {
$newSite = New-VBOBackupItem -Site $Site

#Attempt to create the backup job for the filtered letter if it doesn't exist.
try{
$job = Add-VBOJob -Organization $org -Name $letter -repo $repo -SelectedItems $newSite
}
#If the job exists, add the site to the existing job
catch{
$job = Get-VBOJob -name $letter
Add-VBOBackupItem -Job $Job -BackupItem $newSite
}
}
}

#Increment the job name's 4th (hier für uns 11ter) character to the next letter.
$SPjob[-1]++
$letter=[char[]]$SPjob -join ""

$i++

}

Statistics: Posted by pbleysva — Aug 01, 2025 9:58 am



Viewing all articles
Browse latest Browse all 9932

Latest Images

Trending Articles



Latest Images