How do I catch/select guest user's display name specifically using powershell?

Kerwin Rean Kallego 61 Reputation points
2023-07-10T00:53:56.24+00:00

Get-AzureAdUser -All $true -Filter "Usertype eq guest" | Select-Object -Property Displayname

Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

Accepted answer
  1. James Hamil 27,221 Reputation points Microsoft Employee Moderator
    2023-07-10T20:35:05.45+00:00

    Hi @Kerwin Rean Kallego I saw you figured out a solution! For others, you could do it this way too:

    $guestUsers = Get-AzADUser -UserType Guest
    foreach ($user in $guestUsers) {
       //dosomething $user.DisplayName
    }
    
    
    

    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. Kerwin Rean Kallego 61 Reputation points
    2023-07-10T01:43:31.32+00:00

    Nevermind done figuring out Lol

    Get-AzureADUser -All $true -Filter "Usertype eq 'guest'" | Where-Object {$_.DisplayName -eq "(Any_Name)"

    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.