Forum Discussion
JakobRohde
Jul 31, 2017Iron Contributor
List external users and their status
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 T...
Karen Glynn
Oct 01, 2018Copper Contributor
Thjat doesn't really cut it. I need to see which guest users have activated their accounts, not look for invitations etc.
Kyle Burns
Mar 25, 2020Copper Contributor
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