Skip to content

Restore a File Hosted in a Private Teams Channel from Version History

Step 1: Find the Private Channel's SharePoint Site URL

  1. In the private channel, click on the Files tab
  2. Click "Open in SharePoint" at the top
  3. Copy the URL - it will look like: https://yourtenantname.sharepoint.com/sites/TeamName-PrivateChannelName

:::info Alternatively, you can find it via PowerShell if the above doesn't work. :::

Step 2: Grant Yourself Site Collection Admin Rights

I had to use the PowerShell method (Option B) as the site was not found when searching for it in the SharePoint admin center

Option A: SharePoint Admin Center (Easiest)

  1. Go to SharePoint Admin Center (admin.microsoft.com → SharePoint)
  2. Click Active sites
  3. Search for the private channel site (use the site name or URL from Step 1)
  4. Select the site, then click Membership in the command bar
  5. Under Site admins, click Manage
  6. Add yourself as a site collection administrator

Option B: PowerShell (If the site isn't showing up yet)

Install-Module -Name Microsoft.Online.SharePoint.PowerShell

Connect-SPOService -Url https://yourtenantname-admin.sharepoint.com

Set-SPOUser -Site "https://yourtenantname.sharepoint.com/sites/TeamName-PrivateChannelName" -LoginName "youremail@domain.com" -IsSiteCollectionAdmin $true

# Real Commands:
Install-Module -Name Microsoft.Online.SharePoint.PowerShell

Connect-SPOService -Url https://rlgbuilds-admin.sharepoint.com

# To ADD Site Collection Administrator permission
Set-SPOUser -Site https://rlgbuilds.sharepoint.com/sites/RLGSafety-GEMSafety -LoginName "jeff.ricica@rlgbuilds.com" -IsSiteCollectionAdmin $true

# To REMOVE Site Collection Administrator permission
Set-SPOUser -Site https://rlgbuilds.sharepoint.com/sites/RLGSafety-GEMSafety -LoginName "jeff.ricica@rlgbuilds.com" -IsSiteCollectionAdmin $false

Step 3: Restore the File Version

  1. Go back to the file in Teams (or in SharePoint directly)
  2. Open Version History
  3. Click Restore on the last good version - it should work now

Step 4: Clean Up (Optional)

After restoring, you may want to remove yourself as Site Collection Admin (command above) if you don't need ongoing access, though keeping it won't hurt anything.