Get-SPOExternalUser cmdlet throws unknown error

Brass Contributor

Hi all

I am trying to do a report of external user on per-site collection basis. Get-SPOExternaluser cmdlet is working with some site collections in the tenant. But for some other site collections, I get the following unknown error. The external users exist in those site collections. 

Does anyone have insights into this?

 

 

Get-SPOExternalUser : Unknown Error
At line:1 char:1
+ Get-SPOExternalUser -SiteUrl https://tenant.sharepoint.com/teams/O ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-SPOExternalUser], ServerException
+ FullyQualifiedErrorId : Unknown Error,Microsoft.Online.SharePoint.PowerShell.GetSPOExternalUser

2 Replies

I'm seeing the same behavior in one tenant, but not in another.  In the tenant that has this problem, the Unknown Error occurs only when the -SiteUrl parameter is provided, and it doesn't matter which site is specified.  If I put in an invalid value for the SiteUrl it reports "File Not Found" instead of Known Error.

@kiran bellala  Did this get resolved or was there a resolution? It appears that when a guest account is disabled in Azure and in the specified site collection this error occurs with Get-SPOExternalUser for that site collection. When you enable the Azure account the cmdlet works again.