We are currently running veeam backup for ms 365 version 6.
Long story short, we are a company sitting in a 365 tenant with a bunch of other companies. What we are looking to do is backup only our particular users data not the entire tenant.
We have most other jobs under control via utilization of dynamic groups, so we basically say if user is a part of the group, then back them up. The only problem we have at the moment is Teams. Because the teams can be called stuff like "Water Sector", yes that's a real example of a team that belongs to us, we had to know a way to find everything that's ours.
So we wrote something that queries the dynamic 365 group we are already using above, and said give me a list of all teams created by anyone in the group, yay, so we have a CSV list of all teams that we own.
Now the next challenge, how to get that list of teams into our existing job, and update it.
This is where we have tried all manner of combinations (including getting chat GPT to write stuff) and haven't found something that works yet.
Below is the closest thing we have, but it's still very much broken:
Code: Select all
# Import the Veeam Backup for Microsoft Teams module
Import-Module Veeam.Archiver.PowerShell
# Retrieve the existing job by its name
$existingJob = Get-VBOJob -Name "SWC-Teams"
# Import the CSV file
$sites = Import-Csv -Path 'C:\temp\teams.csv'
# Iterate through each row in the CSV file
foreach ($site in $sites) {
# Create a new Veeam Backup for Microsoft Teams site object
$teamsSite = New-Object -TypeName Veeam.Archiver.Data.ObjectModel.Teams.TeamsSite -ArgumentList $site.Name, $site.Url
# Create a new backup item for the Teams site
$newItem = New-VBOBackupItem -TeamsSite $teamsSite.Site
# Add the new backup item to the existing job
Add-VBOBackupItem -Item $newItem -Job $existingJob
}
"DisplayName"
"example123",
"example456",
"example789",
"example101112",
Cheers.