External users per site collections

%3CLINGO-SUB%20id%3D%22lingo-sub-1159652%22%20slang%3D%22en-US%22%3EExternal%20users%20per%20site%20collections%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1159652%22%20slang%3D%22en-US%22%3E%3CDIV%3E%3CFONT%3EWe%20need%20to%20find%20all%20the%20site%20collections%20one%20external%20user%20has%20access%20to.%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CFONT%3EI%20tried%20the%20script%20with%20Get-SPOExternalUser%20to%20find%20all%20external%20users.%20Plenty%20of%20advice%20in%20blogs%2C%20great!%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fvladtalkstech.com%2F2018%2F03%2Fcreate-a-report-of-sharepoint-online-external-users-with-powershell.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fvladtalkstech.com%2F2018%2F03%2Fcreate-a-report-of-sharepoint-online-external-users-with-powershell.html%3C%2FA%3E%3CBR%20%2F%3E%3CA%20href%3D%22http%3A%2F%2Fwww.balestra.be%2F2018%2F04%2Flist-all-external-users-on-all-sharepoint-online-sites-in-powershell.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fwww.balestra.be%2F2018%2F04%2Flist-all-external-users-on-all-sharepoint-online-sites-in-powershell.html%3C%2FA%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%3E%3CBR%20%2F%3EHowever%2C%20I%20would%20need%20to%20be%20a%20site%20collection%20administrator%20of%20all%20the%20site%20collections.%20And%20it%20sounds%20extreme.%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CFONT%3EHow%20did%20you%20solve%20it%20in%20your%20tenant%3F%20Do%20you%20have%20a%20user%20who%20is%20an%20admin%20of%20all%20the%20site%20collections%3F%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CFONT%3EShould%20I%20grant%20access%20as%20a%20site%20coll%20admin%20(Set-SPOUser%20-site%20%24SiteCollURL%20-LoginName%20%24SiteCollectionAdmin%20-IsSiteCollectionAdmin%20%24True)%20before%20checking%20Get-SPOExternalUser%20and%20then%20remove%20the%20user%3F%20%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CFONT%3EAlso%2C%20there%20is%20another%20pitfall.%20When%20the%20permissions%20of%20an%20external%20user%20are%20deleted%20from%20a%20site%20collection%2C%20we%20can%20still%20see%20it%20with%20Get-SPOExternalUser%20because%20the%20user%20stays%20in%20the%20SharePoint%20UserInfo%20List.%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-ca%2Fsharepoint%2Fremove-users%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-ca%2Fsharepoint%2Fremove-users%3C%2FA%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fsharepoint%2Flist-external-users-with-access-to-content-on-a-site%2Fm-p%2F45316%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fsharepoint%2Flist-external-users-with-access-to-content-on-a-site%2Fm-p%2F45316%20%3C%2FA%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CFONT%3EAny%20advice%20is%20welcomed%20%3A)%3C%2Fimg%3E%3C%2FFONT%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1159652%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1159885%22%20slang%3D%22en-US%22%3ERe%3A%20External%20users%20per%20site%20collections%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1159885%22%20slang%3D%22en-US%22%3EThat's%20beause%20to%20execute%20a%20PS%20Script%20agains%20a%20site%20you%20need%20to%20be%20at%20least%20Site%20Collection%20Admin%20If%20I'm%20correct%3C%2FLINGO-BODY%3E
Highlighted
Contributor
We need to find all the site collections one external user has access to.
 

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.
 
Any advice is welcomed :)
1 Reply
Highlighted
That's beause to execute a PS Script agains a site you need to be at least Site Collection Admin If I'm correct