Report on external users in SharePoint Online:
a small PowerShell script which will help you in getting the list of all the external users in your SharePoint Online tenant. Unlike the “Get-SPOExternalUser” PowerShell command this will display the list of all sites in SharePoint Online , the external sharing status of those sites as well as with whom the sites are shared with externally . This can be used handy by Offic6 365 global admins or SharePoint Online admins to get a report of external sharing/users in their tenant.
Let’s take a look at the script now …
Step1:
Run this command in the SharePoint online management shell to connect to your tenant.
Connect-SPOService -Url <<URL>> $credentials
Step 2 :
Once done with the first command run the below mentioned command to get the report.
$SiteCount= 0
ForEach ($site in Get-SPOSite) {
$SiteCount++
Write-Host “Site number: ” $SiteCount
$site.Url
$site.Owner
$site.SharingCapability
Get-SPOExternalUser -SiteUrl $site.Url
}
This is how the result of this script will look like, check the image below ….

I hope this helps you to get the report
Comments
Post a Comment