To avoid running out of space in the Backup Repository used by Veeam Backup for Microsoft 365, it may be useful to delete OneDrive backup to make room in the storage.
Based on the 365 used plan, Microsoft 365 users have by default 1TB OneDrive space available and it's easy to imagine that you need a large Backup Repository to store all users' files.
Delete OneDrive backup
While in Veeam Backup & Replication you can delete specific backups easily, in Veeam Backup for Microsoft 365 the situation is more complicated as the backup mechanism is different. All 365 backups are part of the "same file" and you cannot remove them with a simple click. Using PowerShell is however a quite simple solution to delete OneDrive backup.
First we need to check the Backup Repository usage to evaluate if the storage is running out of space. Go to Backup Infrastructure > Backup Repository section and select the Repository to analyze. In the example there are 1.9 TB free space.
Before proceeding with the delete OneDrive backup operation, it is recommended to disable the OneDrive Backup Job. Right click the Backup job and select Disable.
Make sure the Backup Job is disabled.
Now open a text editor like Notepad and paste the following script:
$repo = Get-VBORepository -Name "Name_Repository"
$usersList = Get-VBOEntityData -Type User -Repository $repoforeach ($user in $usersList) {
Remove-VBOEntityData -Repository $repo -User $user -OneDrive -Confirm:$false
}
Open the Veeam Backup for Microsoft 365 PowerShell Toolkit and run the script. The script will only delete OneDrive backup leaving Exchange, SharePoint or Teams backups untouched.
PS C:\> .\script_name.ps1
The OneDrive data are removed from the Backup Repository.
After a few minutes, the process has completed successfully.
Checking the repository, the available space is now 2.9 TB. In this example, deleting the OneDrive backup saved 1TB space in the Backup Repository.
If you have issues with OneDrive backup, using this script can help to free up storage space.