Getting current logged in user in Windows Virtual Desktop (WVD)

MirceaD 21 Reputation points
2020-10-19T13:41:37.503+00:00

Having an Azure AD user logged in in a Windows Virtual Desktop (WVD) windows-client and a .NET application launched from this WVD, is it possible to read, from the C# code, the authenticated user in WVD (or a Token)?

Maybe an equivalent for System.Security.Principal.WindowsIdentity.GetCurrent()

The idea is to get a Token ID associated with the Azure user's Object ID.

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

Accepted answer
  1. Andreas Baumgarten 109.9K Reputation points MVP
    2020-10-19T17:15:50.237+00:00

    It's possible to get all the user sessions via PowerShell cmdlet. Maybe this helps.

    import-module az
    $subID = "xxxxxxxx"
    $resgroup = "xxyz-rg"
    $hostpoolName = "myHostpool"
    
    Get-AzWvdUserSession -SubscriptionId $SubID -ResourceGroupName $resgroup -HostPoolName $hostpoolName | select Name, UserPrincipalName
    

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

    Regards
    Andreas Baumgarten


0 additional answers

Sort by: Most helpful

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.