Veeam for Office 365 – Backup a single OneDrive folder

This is going to be a quick post on how to backup a single OneDrive folder with Veeam Backup for Office 365. One of my customers developed an internal policy regarding the usage of OneDrive for Business. The policy is, that each user has a specific “Work” folder (root folder) which gets backed up with Veeam Backup for Office 365. All other folders are not backed up and the users know that. So in this scenario we needed a OneDrive backup job, which backs up the whole organization with the OneDrive object and only includes that work folder. By the way, you are also able to exclude specific OneDrive folders by using the “-ExcludedOneDriveFolders” variable. However, in my case here it makes more sense to only include that specific folder.

The scenario

I recreated that scenario with my own Office 365 Tenant, whereby I selected to only backup my webhosting folder. If you didn’t know it already, the ability to exclude or include specific folders for OneDrive backups is only available by using PowerShell. Here is the related command and its parameters.

So what I did is the following:

$Organization = Get-VBOOrganization -Name "office365.virtualhome.blog"
$Repository = Get-VBORepository -Name "ONEDRIVE"
$ItemToBackup = New-VBOBackupItem -Organization $Organization -OneDrive
Add-VBOJob -Organization $Organization -Name "ONEDRIVE BACKUP" -Repository $Repository -SelectedItems $ItemToBackup -SelectedOneDriveFolder "Falko Banaszak Webhosting"

I created some variables for the organization, the repository and the item I wanted to back up. With the “-SelectedOneDriveFolder” parameter, I’ve set the job to only process the folder “Falko Banaszak Webhosting”.

Veeam Backup for Office 365 - Backup a single OneDrive folder

After my job has been successfully created, I created another variable for my new job and started it immediately:

$BackupJob = Get-VBOJob -Name "ONEDRIVE BACKUP"
Start-VBOJob -Job $BackupJob

Veeam Backup for Office 365 - Backup a single OneDrive folder

Remember: If you start a job in PowerShell, you have to wait until it is finished. If you do not wait, it cancels the job.

So I waited until the job was finished.

After the job completed successfully, I checked the Veeam Explorer for OneDrive.

Finally, you can see, that the job was succesful and did only backup the “Falko Banaszak Webhosting” folder.

As always, thanks for reading and have a great time!

About Falko Banaszak

Falko is a Consulting Field Solutions Architect for Modern Data Protection based in Germany working at Pure Storage Inc. In the last 12 years he has built a strong focus on virtualization, BCDR and has a passion for Microsoft 365 & storage systems. He's a Veeam Vanguard, a Veeam Certified Engineer, Veeam Certified Architect and a Veeam User Group founder and leader in Germany.

Check Also

vSphere Tagging Tool HTML5

Supercharge Excel with ChatGPT

Introduction and why I Supercharge Excel with ChatGPT When you read “Supercharge Excel with ChatGPT”, …

2 comments

  1. Do you have the same thing for SharePoint?

Leave a Reply

Your email address will not be published. Required fields are marked *