0

I need some help regarding PowerShell and SPO.

I want to have a report showing all groups an external user is a member of in a site collection. For internal users, this is simply done that way:

Get-SPOUser -Site *SiteCollection* -LoginName *UserName* | Select-Object -ExpandProperty Groups

But i cannot figure out how to get a similar result for external users.

Get-SPOUser is not working with external accounts as far as I can see, Get-SPOExternalUser is not capable of showing the Groups a user is in...

Thanks in advance!

0

In SharePoint Online, the user LoginName for the external user is formatted as "user_contoso.com#ext#@tenant.onmicrosoft.com".

For example: an external user with "user@outlook.com" email, his LoginName is "user_outlook.com#ext#@tenant.onmicrosoft.com.

Use the following commands to get groups:

Get-SPOUser -Site "https://tenant.sharepoint.com/Sites/<site>" -LoginName "user_domain.com#ext#@tenant.onmicrosoft.com" | Select-Object -ExpandProperty Groups
  • Perfect, this solves my issue! Did not expect to need that extended format... – SPO-Guy Nov 22 '18 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.