Search for Azure AD B2B Guests who have not redeemed their invitations

By | May 24, 2019

Earlier this week, I had a need to produce a list of Guest users in an Azure AD tenant who had not yet redeemed invitations that had been sent to them.  It took me a little while to figure out the Powershell query for this, so I thought I would share it here.

The state of the Guest user is buried in the ExtensionProperty attribute that is returned from the Get-AzureADUser cmdlet.

B2B_14

For Guest users that have redeemed their invitations, the value returned is ‘Accepted’, while for those who have yet to accept the invitations the value is ‘PendingAcceptance’.

The query to find all Guest users who have not yet redeemed their invitations looks for the ‘PendingAcceptance’ value as follows:

Get-AzureADUser -Filter “Usertype eq ‘Guest'” | ? {$_.extensionproperty.userState -eq “PendingAcceptance”} | select mail

Please leave a comment if you have a simpler or more effective way of doing the same thing.  Thanks!

One thought on “Search for Azure AD B2B Guests who have not redeemed their invitations

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.