Forum Discussion
Brandccc
Jun 29, 2023Copper Contributor
Getting the owners for all SharePoint sites in tenant using Powershell
I need to get the owners of all SharePoint sites (both classic, modern and SharePoint sites connected to Teams) I have run the following but it only gives me limited owners and not all the owners, f...
Zenul
Jul 25, 2024Copper Contributor
Hi everyone,
I'm trying to retrieve all SharePoint site groups along with their respective owners, members, visitors, and guests. While I can see visitors from the admin center and SharePoint admin center, my script encounters "access denied" errors when I run it. Interestingly, the script works perfectly on a test site where I've given our admin account site admin access.
Currently, I am trying to get owners, members, guests, channels, sharepoint site list from Teams and visitors from sharepoint using Get-SPOSiteGroup. I am getting every info instead of visitors if i run a loop. If i run a script for a particular site then it gives the visitors easily.
Is there a different parameter I should be using, or is my approach incorrect for retrieving visitors from Teams-enabled sites? Any guidance or suggestions would be greatly appreciated!
I've put my question on another discussion
https://techcommunity.microsoft.com/t5/microsoft-teams/retrieving-sharepoint-site-visitors-using-powershell-script/m-p/4198417/highlight/true#M134924
Thanks in advance!
I'm trying to retrieve all SharePoint site groups along with their respective owners, members, visitors, and guests. While I can see visitors from the admin center and SharePoint admin center, my script encounters "access denied" errors when I run it. Interestingly, the script works perfectly on a test site where I've given our admin account site admin access.
Currently, I am trying to get owners, members, guests, channels, sharepoint site list from Teams and visitors from sharepoint using Get-SPOSiteGroup. I am getting every info instead of visitors if i run a loop. If i run a script for a particular site then it gives the visitors easily.
Is there a different parameter I should be using, or is my approach incorrect for retrieving visitors from Teams-enabled sites? Any guidance or suggestions would be greatly appreciated!
I've put my question on another discussion
https://techcommunity.microsoft.com/t5/microsoft-teams/retrieving-sharepoint-site-visitors-using-powershell-script/m-p/4198417/highlight/true#M134924
Thanks in advance!
Barbarur
Jul 25, 2024Brass Contributor
Are you Site Collection Admin of the site where you get error? Being SharePoint Admin is not enough for running Get-SPOSiteGroup