Get-SPOExternalUser cmdlet throws unknown error

%3CLINGO-SUB%20id%3D%22lingo-sub-261647%22%20slang%3D%22en-US%22%3EGet-SPOExternalUser%20cmdlet%20throws%20unknown%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-261647%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20do%20a%20report%20of%20external%20user%20on%20per-site%20collection%20basis.%20Get-SPOExternaluser%20cmdlet%20is%20working%20with%20some%20site%20collections%20in%20the%20tenant.%20But%20for%20some%20other%20site%20collections%2C%20I%20get%20the%20following%20unknown%20error.%20The%20external%20users%20exist%20in%20those%20site%20collections.%26nbsp%3B%3C%2FP%3E%3CP%3EDoes%20anyone%20have%20insights%20into%20this%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGet-SPOExternalUser%20%3A%20Unknown%20Error%3CBR%20%2F%3EAt%20line%3A1%20char%3A1%3CBR%20%2F%3E%2B%20Get-SPOExternalUser%20-SiteUrl%20%3CA%20href%3D%22https%3A%2F%2Ftenant.sharepoint.com%2Fteams%2FO%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Ftenant.sharepoint.com%2Fteams%2FO%3C%2FA%3E%20...%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20InvalidOperation%3A%20(%3A)%20%5BGet-SPOExternalUser%5D%2C%20ServerException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20Unknown%20Error%2CMicrosoft.Online.SharePoint.PowerShell.GetSPOExternalUser%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-261647%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Eexternal%20users%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EGuest%20Users%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-279799%22%20slang%3D%22en-US%22%3ERe%3A%20Get-SPOExternalUser%20cmdlet%20throws%20unknown%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-279799%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20seeing%20the%20same%20behavior%20in%20one%20tenant%2C%20but%20not%20in%20another.%26nbsp%3B%20In%20the%20tenant%20that%20has%20this%20problem%2C%20the%20Unknown%20Error%20occurs%20only%20when%20the%20-SiteUrl%20parameter%20is%20provided%2C%20and%20it%20doesn't%20matter%20which%20site%20is%20specified.%26nbsp%3B%20If%20I%20put%20in%20an%20invalid%20value%20for%20the%20SiteUrl%20it%20reports%20%22File%20Not%20Found%22%20instead%20of%20Known%20Error.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1211601%22%20slang%3D%22en-US%22%3ERe%3A%20Get-SPOExternalUser%20cmdlet%20throws%20unknown%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1211601%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F3755%22%20target%3D%22_blank%22%3E%40kiran%20bellala%3C%2FA%3E%26nbsp%3B%20Did%20this%20get%20resolved%20or%20was%20there%20a%20resolution%3F%20It%20appears%20that%20when%20a%20guest%20account%20is%20disabled%20in%20Azure%20and%20in%20the%20specified%20site%20collection%20this%20error%20occurs%20with%20Get-SPOExternalUser%20for%20that%20site%20collection.%20When%20you%20enable%20the%20Azure%20account%20the%20cmdlet%20works%20again.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
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.