Sharepoint Powershell Error Get-SPOUser : Access is denied. (Exception from HRESULT: 0x80070005

Kanta Prasad 41 Reputation points
2021-10-13T08:59:24.687+00:00

I have a list of Sharepoint site URLS in below mentioned CSV file. I am already Sharepoint Administrator and Global Administrator as well in our Office 365 tenant.

Could you please help me how can I avoid below error and get the list of permissions and other sharepoint site attributes as :(DisplayName,LoginName,IsSiteAdmin,IsGroup,UserType)

Import-csv c:\temp\Sites_URL_Lists.csv

Get-SPOSite -Limit 1 | ForEach {Get-SPOUser –Site $_.Url} | ft -a

Get-SPOUser : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Microsoft 365 and Office | SharePoint | For business | Windows
{count} votes

Answer accepted by question author
  1. Emily Du-MSFT 51,941 Reputation points Microsoft External Staff
    2021-10-14T02:51:02.597+00:00

    @Kanta Prasad

    Microsoft 365 Administrator Role (SharePoint Administrator, Global Administrator) will not automatically be given rights to site collections, site contents and so on. You must have appropriate rights at the site collection level.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    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.


1 additional answer

Sort by: Most helpful
  1. Sebastian Cerazy 321 Reputation points
    2025-11-13T12:00:41.5666667+00:00

    That is absolutely diabolical design!

    I need to remove a user from EVERY site collection admins, for which I would need to add ANOTHER user first.

    What a joke!

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.