You could use PowerShell to assign a user access to all SharePoint sites.
#Parameters
$TenantAdminURL="https://tenant-admin.sharepoint.com"
$UserAccount = "admin@M365x68721329.onmicrosoft.com"
#Get Credentials to Connect
$Cred = Get-Credential
Try {
#Connect to Tenant Admin
Connect-PnPOnline -Url $TenantAdminURL -Credentials $Cred
#Get All Site collections - Exclude: Seach Center, Mysite Host, App Catalog, Content Type Hub, eDiscovery and Bot Sites
$Sites = Get-PnPTenantSite | Where -Property Template -NotIn ("SRCHCEN#0", "REDIRECTSITE#0","SPSMSITEHOST#0", "APPCATALOG#0", "POINTPUBLISHINGHUB#0", "EDISC#0", "STS#-1")
#Loop through each Site Collection
ForEach ($Site in $Sites)
{
Try {
#Connect to the Site
Connect-PnPOnline -Url $Site.Url -Credentials $Cred
#Permission Level to Grant
$PermissionLevel = "Contribute"
#grant permission Level to the user
Set-PnPWebPermission -User $UserAccount -AddRole $PermissionLevel
}
Catch {
write-host -f Red "Error Adding User to the Site: $($Site.URL)" $_.Exception.Message
}
}
}
Catch {
write-host -f Red "Error:" $_.Exception.Message
}
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.