Answer · Medium impact

Site owner gets Access denied after a SharePoint migration

Symptom

After migrating a site, the business owner cannot open site settings or share content, although they owned the site before.

Cause

Permissions were mapped to a different identity, or the owner was added as a member but not as a site collection administrator or owner in the target.

Resolution

  1. Check who the site collection administrators are.

  2. Add the owner as a site collection administrator or to the Owners group.

  3. Check the identity mapping used by the migration and correct it for the remaining sites.

Script

PowerShell
Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/finance -Interactive -ClientId <client-id>
Get-PnPSiteCollectionAdmin
Add-PnPSiteCollectionAdmin -Owners owner@contoso.com

Related script sample

Report site collection administrators for every site →

Disclaimer. These samples are provided as is, without warranty of any kind. Read and test every script in a non-production tenant before you run it, and run reports before any command that changes or deletes data.