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

Kanta Prasad 26 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))

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,701 questions
0 comments No comments
{count} vote

Accepted answer
  1. Emily Du-MSFT 41,941 Reputation points Microsoft Vendor
    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.


0 additional answers

Sort by: Most helpful