Jul 31 2017 01:55 AM
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
Jul 31 2017 02:22 AM - edited Jul 31 2017 02:32 AM
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.
Jul 31 2017 03:34 AM
Hi @Jakob Rohde,
a few years ago I battled with the same:
I didn't get the full answer of your problem either, but at least I was able to get all of my active users.
Aug 01 2017 02:57 AM
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
Aug 01 2017 09:42 AM
You can check this article as it explains managing access requests and guest users with pending invitation.
Oct 01 2018 07:06 AM
Thjat doesn't really cut it. I need to see which guest users have activated their accounts, not look for invitations etc.
Mar 25 2020 03:33 PM
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