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

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,525 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,796 questions
{count} votes

Accepted answer
  1. James Hamil 24,666 Reputation points Microsoft Employee
    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.