SharePoint Online - Site Permissions Report for all users with all sites.

zaid Shaikh 41 Reputation points
2020-07-30T00:29:22.713+00:00

I would like to export all site names along with the user who is having access on that site.

I have tried below command mentioned in your documentation link and not getting expected result.
Get-SPOSite | ForEach {Get-SPOUser –Site $_.Url} | Format-Table -Wrap -AutoSize | Out-File c:\UsersReport.txt -Force -Width 360 -Append

https://learn.microsoft.com/en-us/office365/enterprise/powershell/manage-sharepoint-users-and-groups-with-powershell
The above command returns some unexpected result, like it returns the System users as well.
Example: SHAREPOINT\system , nt service\spsearch

I have also tried script mentioned in below article.
And this only provide Group names of the mentioned sites.
https://gallery.technet.microsoft.com/office/SharePoint-Online-c9ec4f64

I would like to export all site names along with the user who is having access on that site.
Please help if any available Script.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,607 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,798 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Itch Sun-MSFT 2,556 Reputation points
    2020-07-30T07:14:16.667+00:00

    You can refer to the sample code in the document I uploaded.

    This command will also export a user name similar to SHAREPOINT\system, which is unavoidable, SHAREPOINT\system is the system automatically generated users.

    In addition, you can also refer to the article below:

    SharePoint Online: User Permissions Audit Report for a Site Collection using PnP PowerShell

    Please note: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.

    14531-code-sample.txt

    1 person found this answer helpful.