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

Sriram Varadarajan
 
Solution Architect
July 30, 2016
 
Rate this article
 
Views
8306

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

Author Info

Sriram Varadarajan
 
Solution Architect
 
Rate this article
 
Sriram is a Technology Evangelist with 15+ years experience in Microsoft Technologies. He is an enterprise architect working for large pharmaceutical organization which has presence globally with largest Microsoft implementation ...read more
 

Leave a comment