Maintain control of your Microsoft 365 data
Post Reply
Chrigp
Novice
Posts: 9
Liked: never
Joined: Jan 10, 2019 11:18 am
Full Name: Christian Pellicci
Contact:

Clearing Back-up Repositories

Post by Chrigp »

Was just wandering if there was script to completely wipe a back-up repository.

Many thanks in advance,
Mike Resseler
Product Manager
Posts: 8044
Liked: 1263 times
Joined: Feb 08, 2013 3:08 pm
Full Name: Mike Resseler
Location: Belgium
Contact:

Re: Clearing Back-up Repositories

Post by Mike Resseler »

Hi Chrigp,

Not sure what your intention is. Do you want to remove an entire backup repository? Or clean-out certain data of a certain user(s)?
Chrigp
Novice
Posts: 9
Liked: never
Joined: Jan 10, 2019 11:18 am
Full Name: Christian Pellicci
Contact:

Re: Clearing Back-up Repositories

Post by Chrigp »

Hi Mike,

Want to remove an entire backup repository.

Kind regards
nielsengelen
Product Manager
Posts: 5619
Liked: 1177 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Clearing Back-up Repositories

Post by nielsengelen »

There are multiple options here. If you don't use the repository anymore, you can just remove it from the GUI and afterward go to the directory and shift+delete everything.

Additionally, you can leverage Powershell and use Remove-VBOEntityData.

A script which should do the work (it won't remove the files however but it will clear the repository):

Code: Select all

Import-Module "C:\Program Files\Veeam\Backup365\Veeam.Archiver.PowerShell\Veeam.Archiver.PowerShell.psd1"

$repo = Get-VBORepository -Name "REPONAME"
$usersList = Get-VBOEntityData -Type User -Repository $repo
$groupsList = Get-VBOEntityData -Type Group -Repository $repo
$sitesList = Get-VBOEntityData -Type Site -Repository $repo

foreach ($user in $usersList) {
 Remove-VBOEntityData -Repository $repo -User $user -Mailbox -ArchiveMailbox -OneDrive -Sites -Confirm:$false
}

foreach ($group in $groupsList) {
 Remove-VBOEntityData -Repository $repo -Group $group -Mailbox -ArchiveMailbox -OneDrive -Sites -GroupMailbox -GroupSite -Confirm:$false
}


foreach ($site in $sitesList) {
 Remove-VBOEntityData -Repository $repo -Site $site -Confirm:$false
}

Remove-VBORepository -Repository $repo -Confirm:$false
If you want to wipe the directory, you should leverage native PowerShell "Remove-Item -Recurse -Force c:\myrepo".
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
Chrigp
Novice
Posts: 9
Liked: never
Joined: Jan 10, 2019 11:18 am
Full Name: Christian Pellicci
Contact:

Re: Clearing Back-up Repositories

Post by Chrigp »

Many thanks,

Knew how to do through the GUI, just wanted a script that did such. Script worked perfectly.

Kind regards
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests