I've just started backing up MS Teams with Veeam o365 and since Veeam doesn't support private channels, you may need to get the private group URL in order to backup the contents in private channels of teams.
Code: Select all
#This script will get you the entire UnifiedGroup in your tenant.
$Sites = Get-SPOSite -Template "TeamChannel#0"
ForEach ($Site in $Sites) {
$SPOSite = Get-SPOSite -Identity $Site.url -detail
$Group = Get-UnifiedGroup -Identity $SPOSite.RelatedGroupID.Guid
Write-Host "Team" $Group.DisplayName "owns private channel site" $Site.URL}
Code: Select all
#This script will give you the SharePoint url of each private channel in single Team only.
$sites = get-sposite -template "teamchannel#0"
$GroupID = "defMS-TeamGroupId70a2cb3db" #or $GroupId = Get-Team | Where {$_.DisplayName -eq "BAH-Test"} | Select GroupId
foreach ($site in $sites) {$x= Get-SpoSite -Identity $site.url -Detail; if ($x.RelatedGroupId -eq $groupID) {$x.RelatedGroupId;$x.url}}
Code: Select all
#Have a text file contains the site URLs and a header name called Site.
$Org = Get-VBOOrganization -Name "cxcxcxc.onmicrosoft.com"
$Job = Get-VBOJob -Name "Test"
Import-Csv -Path C:\Scripts\SitesURL.txt | ForEach-Object{
$st = Get-VBOOrganizationSite -Organization $Org -Url $_.'Site'
$newSite = New-VBOBackupItem -site $st
Add-VBOBackupItem -Job $Job -BackupItem $newSite
}
Thanks,