Report on external users in SharePoint Online:

SP Online image

Alright in this post I’m going to introduce you all to 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 https://office365admin123-admin.sharepoint.com-credential $credentials 

Step 2 :

Once done with the first command run the below mentioned command to get the report.

$i = 0

ForEach ($site in Get-SPOSite) {

$i++

    Write-Host “*********”

    Write-Host “Site number: ” $i

    $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 ….

Result 2

I hope this helps you to get the report may be once in a week or a month. Thanks for reading this post…Happy SharePointing !!!

Advertisement

One thought on “Report on external users in SharePoint Online:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s