Forum Discussion
Getting the owners for all SharePoint sites in tenant using Powershell
Just for clarification - currently only 1 member of the "Site admins" are being listed for each site instead all the members of the "Site members" group which is what I need. There are the following groups for classic SharePoint sites - Site admin, Site owners, Site members and Site visitors - it is the Site owners members that I am interested in.
If I remember well, this script should give you all the users inside the SharePoint Groups "Site Owners" and "Site Members": https://github.com/Barbarur/NovaPointPowerShell/blob/main/Solutions/Report/Permissions%20report%20of%20a%20SharePoint%20Online%20Site.md#users-with-access-at-the-site-level
Also the app NovaPoint (https://github.com/Barbarur/NovaPoint) can help with it. Using this Solution https://github.com/Barbarur/NovaPoint/wiki/Solution-Report-SiteAllReport, it will give you the users inside the SharePoint Groups "Owners" and "Members" and if inside those groups you have a Security Group, it will give you also the users inside those Security Groups.
In practice you will get a report with all users inside all the SharePoint Groups and Security Groups with Access to the site. The report is structured to show which users are inside which SharePoint Group/Security Group, so you can easily filter out the "owners" and "members" from the final report.
- BrandcccJul 17, 2023Copper Contributor
Thank you Barbarur, I used the script you mention (https://github.com/Barbarur/NovaPointPowerShell/blob/main/Solutions/Report/Permissions%20report%20of%20a%20SharePoint%20Online%20Site.md#users-with-access-at-the-site-level)
Which worked to give me the site owners of standalone/classic sharepoint sites, but not the owners of associated SharePoint sites (linked) to a Team.
Do you know how I can get the list of owners of Teams (and the associated) SharePoint site?Thank you for your help
- BarbarurJul 17, 2023Brass Contributor
For the Teams Site, the SharePoint Group "Site owners" is generally empty. The Owners of the MS365 Group are the Site Admins, so you won't see them inside the "Site owners", thus my original question on what you really needed.
You can use this Script below, it should give you the Admins.
https://github.com/Barbarur/NovaPointPowerShell/blob/main/Solutions/Report/Admins%20of%20all%20Sites%20Collections%20report.md#using-pnp-get-all-site-collection-admins-and-subsite-owners