Maintain control of your Microsoft 365 data
Post Reply
darren_flatman
Influencer
Posts: 11
Liked: never
Joined: Aug 24, 2022 1:03 pm
Full Name: Darren Flatman
Contact:

Powershell cmd to list sites backed up in Sharepoint for job

Post by darren_flatman »

Need a PS script to list all Sharepoint sites backed up by VBO

Have tried the example provided in KB on VBO commands

Code: Select all

$job = Get-VBOJob -Name "Monthly Backup"
$group = Get-VBOBackupItem -Job $job -Groups
$group.Group
Changed to

Code: Select all

$job = Get-VBOJob -Name "Example job"
$Sites = Get-VBOBackupItem -Job $job -Sites
$Sites.Sites
When I run the I get nothing back

If I checked the data in the variable I get
$job
Organization Repository Name IsEnabled LastStatus Description
------------ ---------- ---- --------- ---------- -----------
Example . Example Sharepoint True Running

I tried the Group option too with email/ teams backup get nothing back
Mildur
Product Manager
Posts: 9846
Liked: 2607 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Powershell cmd to list sites backed up in Sharepoint for job

Post by Mildur »

Hi Darren

Do you want to export a job configuration or what was actually backed up?
With Get-VBOBackupItem you get the items added to a job.
If you add Entire organization, the command will not show you single sites. It will show you that you have added the entire organization.

Thanks
Fabian
Product Management Analyst @ Veeam Software
darren_flatman
Influencer
Posts: 11
Liked: never
Joined: Aug 24, 2022 1:03 pm
Full Name: Darren Flatman
Contact:

Re: Powershell cmd to list sites backed up in Sharepoint for job

Post by darren_flatman »

Hi Fabian,

Thanks that makes sense. The entire organisation is added.

I want a script that will list all the sites and subsites that are backed up in the organisation.

The Sharepoint layout is a lot different than the way Veeam is presenting the information in the restore window. Possibly because the site names were changed.

The advanced search option does not seem to get the results I need or it possibly will but is taking a very long time, sometimes days to return a result.

I was hoping to use a PS script to list all sites and subsites in the backup then copy to notepad and use ctrl F to search.

Kind regards,

Darren
Mildur
Product Manager
Posts: 9846
Liked: 2607 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Powershell cmd to list sites backed up in Sharepoint for job

Post by Mildur »

Hi Darren

In that case, you should check out Get-VBOEntityData. It can list all objects in the repositories with their last backup date.
https://helpcenter.veeam.com/docs/vbo36 ... tml?ver=60

Code: Select all

$org = Get-VBOOrganization -Name "Org Name"
$repo = Get-VBORepository -Name "Repo Name"
Get-VBOEntityData -Organization $org -Repository $repo -Type Site
Does that help?

Thanks
Fabian
Product Management Analyst @ Veeam Software
darren_flatman
Influencer
Posts: 11
Liked: never
Joined: Aug 24, 2022 1:03 pm
Full Name: Darren Flatman
Contact:

Re: Powershell cmd to list sites backed up in Sharepoint for job

Post by darren_flatman »

Thanks Fabian,

That looks good for V6. The site I am working on is V5 the options for Get-VBOEntityData are different.

Do you know if there is a way to achieve the same result?

Kind regards,

Darren
Mildur
Product Manager
Posts: 9846
Liked: 2607 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Powershell cmd to list sites backed up in Sharepoint for job

Post by Mildur »

I recommend updating to V6a. V5 didn't had the organization filter.
If you had a repository per organization, you should be able to just filter for the repository.
That should work also for V5.

Code: Select all

$repo = Get-VBORepository -Name "Repo Name"
Get-VBOEntityData -Repository $repo -Type Site
Product Management Analyst @ Veeam Software
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 15 guests