question

ZaidShaikh avatar image
0 Votes"
ZaidShaikh asked itchsun-msft commented

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

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://docs.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.

office-sharepoint-onlineoffice-sharepoint-server-administration
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

itchsun-msft avatar image
1 Vote"
itchsun-msft answered itchsun-msft commented

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



code-sample.txt (993 B)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank so much @itchsun-msft
I will try this.

0 Votes 0 ·

Any progress on your troubleshooting?

0 Votes 0 ·