Forum Discussion
kmktnn
Feb 07, 2020Iron Contributor
External users per site collections
We need to find all the site collections one external user has access to.
I tried the script with Get-SPOExternalUser to find all external users. Plenty of advice in blogs, great!
https://vladtalkstech.com/2018/03/create-a-report-of-sharepoint-online-external-users-with-powershell.html
http://www.balestra.be/2018/04/list-all-external-users-on-all-sharepoint-online-sites-in-powershell.html
https://vladtalkstech.com/2018/03/create-a-report-of-sharepoint-online-external-users-with-powershell.html
http://www.balestra.be/2018/04/list-all-external-users-on-all-sharepoint-online-sites-in-powershell.html
However, I would need to be a site collection administrator of all the site collections. And it sounds extreme.
How did you solve it in your tenant? Do you have a user who is an admin of all the site collections?
Should I grant access as a site coll admin (Set-SPOUser -site $SiteCollURL -LoginName $SiteCollectionAdmin -IsSiteCollectionAdmin $True) before checking Get-SPOExternalUser and then remove the user?
Also, there is another pitfall. When the permissions of an external user are deleted from a site collection, we can still see it with Get-SPOExternalUser because the user stays in the SharePoint UserInfo List.
https://docs.microsoft.com/en-ca/sharepoint/remove-users
https://techcommunity.microsoft.com/t5/sharepoint/list-external-users-with-access-to-content-on-a-site/m-p/45316
https://techcommunity.microsoft.com/t5/sharepoint/list-external-users-with-access-to-content-on-a-site/m-p/45316
Any advice is welcomed 🙂
1 Reply
- That's beause to execute a PS Script agains a site you need to be at least Site Collection Admin If I'm correct