List external users and their status

Iron Contributor

Hi all

 

I desperately need a way to list all external Azure AD users including their status (if they have accepted the invitation or not), and it would be nice to be able to filter on domain. On TechNet I have found this PowerShell command:

 

Get-SPOExternalUser -Position 0 -PageSize 30 -Filter @testsite.com

It doesn't work though, because it doesn't accept the "@" and if I use the commend without filter, it doen't list information about the users invitational status.

 

 

Another problem is that -PageSize can't exceed 50 - and we have hundreds of external users.

 

Any suggestions?

 

Thanks

Jakob

6 Replies

You can use the command below to get the list of all the Office 365 external users (guest users).

 

Get-MsolUser -All | ? {$_.UserType -eq "Guest"} | Select DisplayName,SignInName | FT

 

Also, you can use this application to list and export all external users to CSV.

Hi @Jakob Rohde,

 

a few years ago I battled with the same:

 

http://wp.me/p1fg2Y-xTm

 

I didn't get the full answer of your problem either, but at least I was able to get all of my active users.

 

 

 

 

Thanks Aljohn

 

This gives me a list of all guest users. What I need is a list of only those guest users that have not yet accepted the invitation. Is that possible?

 

/Jakob

You can check this article as it explains managing access requests and guest users with pending invitation.

Thjat doesn't really cut it.  I need to see which guest users have activated their accounts, not look for invitations etc.

This is an old thread, but I needed to solve the same problem today and figured it would be good since I came across this thread looking for a solution to document what I came up with here. Hopefully it will be helpful for the next person.  I used the Azure CLI and queried the userState property to identify guest accounts that had not had accepted the invitation. Here is the command I used:

 

az ad user list --query "[?userState == 'PendingAcceptance'].{userType:userType, surname:surname, givenName:givenName, department:department, userState:userState}" --output table