Invited Guests

walid issa 45 Reputation points
2024-07-16T11:47:37.2666667+00:00

Can I use powershell to retrieve all guest users invited in the last three months?

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,898 questions
0 comments No comments
{count} votes

Accepted answer
  1. James Hamil 24,841 Reputation points Microsoft Employee
    2024-07-16T18:43:07.8533333+00:00

    Hi @walid issa , you could try something like this:

    $startDate = (Get-Date).AddMonths(-3)
    $guestUsers = Get-AzureADUser -Filter "UserType eq 'Guest' and WhenCreated -ge $startDate"
    
    

    Please let me know if you have any questions and I can help you further.

    If this answer helps you please mark "Accept Answer" so other users can reference it.

    Thank you,

    James

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Dillon Silzer 57,491 Reputation points
    2024-07-16T15:40:04.14+00:00

    Hi Walid,

    I would try using the scripts listed here:

    https://o365reports.com/2020/11/12/export-office-365-guest-user-report-with-their-membership/

    This utilizes the Audit Log which only has logs up to the past 30 days (you will not be able to see the last three months).

    There you can see the Creation time:

    User's image


    If this is helpful please accept as answer or upvote.

    Best regards,

    Dillon Silzer, Director | Cloudaen.com | Cloudaen Computing Solutions


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.