I have a requirement in which I need to get a list of Azure AD B2B users who haven't accepted the invitation using csom or rest api
Can you please let me know whether graph provides any such endpoints?
According to my research, we can use Microsoft Graph User API to implement it. The user's property externalUserState
represents the invited user's invitation status. For invited users, the state can be PendingAcceptance or Accepted, or null for all other users. But please note that if you want to use Microsoft Graph User API to get the property, we need to beta
version
For example
Get https://graph.microsoft.com/beta/users?$select=externalUserState,displayName,id
Authorization: Bearer <access_token>
https://graph.microsoft.com/beta/users?$select=externalUserState,displayName,id&$filter=externalUserState eq 'PendingAcceptance'
Authorization: Bearer <access_token>