Fix Teams File Shows Access Denied after a SharePoint Site Rename
🔍 WiseChecker

Fix Teams File Shows Access Denied after a SharePoint Site Rename

When you rename a SharePoint site that hosts a Teams team, files in the Files tab may suddenly show Access Denied. This happens because Teams stores a cached reference to the old site URL, and the underlying permission links break after the rename. This article explains why the error occurs and provides a step-by-step fix to restore access.

The issue is not a permissions problem but a URL mismatch. After the site rename, the site collection URL changes, but Teams and OneDrive sync clients still point to the old address. You will learn how to clear the cache, update the sync client, and verify that file permissions remain intact.

By following the steps below, you can resolve the Access Denied error without contacting your SharePoint administrator. You will also learn how to prevent the problem from recurring when you rename sites in the future.

Key Takeaways: Fixing Access Denied After a SharePoint Site Rename

  • Teams admin center > Teams > Manage teams > Channels: Verify that the channel Files tab still points to the correct document library URL.
  • OneDrive sync client > Settings > Pause syncing: Pause and resume sync to force a refresh of the cached site URL and reauthenticate.
  • SharePoint admin center > Active sites > Site address: Confirm the new site URL and compare it with the URL shown in Teams.

ADVERTISEMENT

Why Teams Shows Access Denied After a SharePoint Site Rename

When you rename a SharePoint site, the site collection URL changes from something like contoso.sharepoint.com/sites/oldname to contoso.sharepoint.com/sites/newname. Teams stores a reference to the original URL in its local cache and in the channel’s Files tab. After the rename, this reference becomes stale, and any attempt to open a file results in an Access Denied error because the old URL no longer resolves to a valid resource.

The root cause is not that the user lacks permissions. The user still has access to the site, but the client is trying to reach a location that no longer exists. SharePoint does not automatically update the URL in Teams or in the OneDrive sync client. The error appears only on the client side; the actual files remain accessible through the SharePoint site URL directly.

Another contributing factor is the browser cache or the Teams desktop app cache. These caches store the old URL and may persist even after you refresh the page. The fix involves clearing these caches and forcing Teams to re-resolve the site URL.

Understanding the Role of the Site URL in Teams

Every Teams team is backed by a SharePoint site collection. The Files tab in a channel points to a document library in that site collection. When you rename the site, the document library URL changes, but the Teams channel metadata still holds the old URL. This mismatch is what triggers the Access Denied error.

Steps to Clear Cache and Restore File Access in Teams

The following steps will resolve the Access Denied error by clearing the cached URL and refreshing the connection. Perform these steps in order. If the issue persists, continue to the next section.

  1. Close Teams completely
    Right-click the Teams icon in the system tray and select Quit. Ensure no Teams process is running in Task Manager. This stops any background sync that may hold the stale URL.
  2. Clear the Teams desktop cache
    Press Ctrl + R in the Windows Run dialog, type %appdata%\Microsoft\Teams, and press Enter. Delete the contents of the Cache, Code Cache, and GPUCache folders. Do not delete the entire Teams folder, as that may remove your settings.
  3. Restart Teams and sign in again
    Open Teams and sign in with your work or school account. Teams will rebuild the cache and fetch the correct site URL from the SharePoint backend. Wait for the Files tab to load completely.
  4. Open the Files tab and check the URL
    Navigate to the affected channel and click the Files tab. If the tab shows an error, click the Open in SharePoint link at the top. This opens the document library in your browser with the correct new URL.
  5. Update the OneDrive sync client
    If you use OneDrive to sync the library, open OneDrive settings, select the Account tab, and click Choose folders. Uncheck the affected library, then re-check it. This forces a resync with the new site URL.
  6. Verify permissions on the site
    In the SharePoint site, go to Site permissions and confirm that the affected user or group still has access. If the rename changed the site’s sharing settings, re-add the user.

If the Error Persists After Clearing the Cache

If the Access Denied error still appears, the issue may be in the channel’s document library link. Follow these additional steps:

  1. Remove and re-add the Files tab
    In the channel, click the + icon to add a new tab, select SharePoint Pages, and choose the correct document library. Then delete the old Files tab. This replaces the stale URL with the new one.
  2. Check the SharePoint admin center
    Go to SharePoint admin center > Active sites and find the site. Verify that the Site address matches the URL you see in the browser. If not, you may need to restore the original URL temporarily.

ADVERTISEMENT

If Teams Still Has Issues After the Main Fix

Teams Shows Access Denied in One Channel Only

If only one channel is affected, the channel’s document library may have a unique permission that was not inherited from the site. The rename does not change permissions, but a broken link can cause a false denial. Go to the document library settings and reset the permission inheritance to the site’s parent.

Files Open in the Browser but Not in the Teams Desktop App

This indicates that the Teams desktop app still has a cached URL. Repeat the cache clearing steps, but also clear the browser cache if you opened the file in the default browser. The desktop app uses the same underlying web engine, so clearing the browser cache can help.

Access Denied When Using the OneDrive Sync Client

The sync client may have stored the old site URL in its database. Pause syncing, close OneDrive, and delete the file %localappdata%\Microsoft\OneDrive\settings\Business1\ClientPolicy. Restart OneDrive and resume syncing. This forces a full resync.

New Teams Desktop vs Teams on the Web: Key Differences After a Site Rename

Item New Teams Desktop Teams on the Web
Cache location Stored in %appdata%\Microsoft\Teams Stored in browser cache
URL update after rename Requires manual cache clear Refreshes on page reload
Sync client integration Uses OneDrive sync client No sync client
File access speed Faster after cache rebuild Depends on browser performance

After completing the steps above, you can access your files normally in Teams. The root cause was a stale URL reference, not a permission failure. To avoid this issue in the future, always rename the SharePoint site from the SharePoint admin center and then immediately clear the Teams cache on all affected devices.

If you manage multiple sites, consider creating a site rename checklist that includes cache clearing and sync client updates. For large organizations, you can use PowerShell to automate the cache clear on remote machines. This reduces downtime and prevents user frustration.

Remember that the Files tab in Teams is just a link to the SharePoint library. When that link breaks, the error appears. By verifying the link and the permissions, you can quickly restore access without involving IT support.

ADVERTISEMENT