How to get the list of external users in SharePoint Online if there are more than 1000 external users


Sriram Varadarajan
Enterprise Architect
Published On :   30 Jul 2016
Visit Count
Today :  2    Total :   3426
Plan, Migrate, Secure, Report
SharePoint & Office 365 Tool. Simple & Easy to Use. 15-Day Trial!

SharePoint Office 365 Tool
Simple & Powerful Tool for Migration, Security & Reporting. Free Trial


We will all get in to situation to know the list of external users that we have in our SharePoint Online tenant. Usually , Get-spoexternaluser is the command that is used to fetch the list of external users. But this has a hard limit of fetching max of 1000 users.

Reason

The Get-spoexternaluser uses .Net DirectorySearcher class to get the Guest users from the Tenant. The reason that it can get only 1000 users is due to the fact the limit about the Directory Searcher is 1000.

Options

If your tenant has large number users ( >1000) the list of external users  can be fetched using the  following method

Get-MsolUser -All | ? {$_.usertype -eq "Guest"}

For getting the list of unlicensed users please use the below command:

Get-MsolUser -UnlicensedUsersOnly -All | ? {$_.usertype -eq "Guest"}

Additional Information can be fetched using the Examples in the KB

SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Categories

Migratiin Tools for SharePoint