Query on Azure Virtual Desktop

Roger Roger 4,951 Reputation points
2022-08-02T17:46:24.577+00:00

Hi All

I am using Azure virtual desktop. for example i have a user who has upn, samaccountname and email address in the below format

UPN: temp.user1
SamAccountName: temp.user1
email address: temporary.user1@Company portal .com

which syntax should i use to get sessionhost name. in the below syntax for assigned user will it take upn,samaccountname or email address.

Get-AzWvdSessionHost -ResourceGroupName "myrg" -HostPoolName "mypool" | Where-Object -Property AssignedUser -Eq 'temporary.user1@Company portal .com'

or
Get-AzWvdSessionHost -ResourceGroupName "myrg" -HostPoolName "mypool" | Where-Object -Property AssignedUser -Eq 'temp.user1@Company portal .com'

Azure Virtual Desktop
Azure Virtual Desktop
A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
1,362 questions
0 comments No comments
{count} votes

Accepted answer
  1. Andreas Baumgarten 96,361 Reputation points MVP
    2022-08-02T18:58:25.437+00:00

    Hi @Roger Roger ,

    it should be the user principal name (UPN). The UPN should look like this temp.user1@contoso.com and not like you mentioned in your question temp.user1
    User Principal Name: https://learn.microsoft.com/en-us/windows/win32/secauthn/user-name-formats#user-principal-name

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    0 comments No comments

0 additional answers

Sort by: Most helpful