How to list Guest user using Microsoft Graph?

EnterpriseArchitect 6,061 Reputation points
2023-06-26T14:56:42.71+00:00

What's the Microsoft PowerShell graph for the below query to select the Guest User that is not accepting the invitation yet?

Get-MgUser -Filter "usertype eq 'Guest' -and UserState eq 'PendingAcceptance;" -All -Property CreatedDateTime
Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 119.8K Reputation points MVP Volunteer Moderator
    2023-06-26T15:08:51.23+00:00

    You mean the Graph API query, or? For any of the SDK cmdlets, you can add the -Verbose/-Debug parameters to get the URL called on the backend. So for the above (with some formatting issues fixed) we have:

    Get-MgUser -Filter "userType eq 'Guest' and externalUserState eq 'PendingAcceptance'" -All -Property CreatedDateTime

    which translates to:

    GET https://graph.microsoft.com/beta/users?$filter=userType eq %27Guest%27 and externalUserState eq %27PendingAcceptance%27&$select=CreatedDateTime

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Shawn M. May 5 Reputation points
    2023-10-13T18:09:05.4033333+00:00

    This was helpful. Thank you

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.