How to get a Last Logon Time for my Azure Virtual Desktop machine/users?

Luis Pizarro 0 Reputation points
2025-01-30T15:13:05+00:00

I would like to know if there is a way to get a Last Logon Time for my Azure Virtual Desktop machine/users.

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

2 answers

Sort by: Most helpful
  1. Andrew Coughlin 160 Reputation points Microsoft Employee
    2025-01-30T16:45:01.1133333+00:00

    Hello Luis,

    Welcome to the Microsoft Community Forums. Have you taken a look at Azure Virtual Desktop Insights? Azure Virtual Desktop Insights you can use Azure Monitor to track logon times. Insights measure the time for a desktop experience to launch based on how long it takes to launch Windows Explorer. For RemoteApp, it measures the time taken to launch the first instance of the shell app for a connection.  To set this up you can review: Enable Insights to monitor Azure Virtual Desktop | Microsoft Learn.

    Once you have that configured you could use Log Analytics to capture log analytics for when users log in and out of Azure Virtual Desktops. You might need to create your own workbook or find one that someone else has created to visualize this information.

    0 comments No comments

  2. Akshay kumar Mandha 2,435 Reputation points Microsoft Vendor
    2025-02-04T16:13:41+00:00

    Hi Luis Pizarro,
    I hope doing good.
    For specific steps to get that information from Log Analytic. Please follow as mentioned below
    1.Create Log analytics workspace as per show below image Please refer the documentation how to Create a Log Analytics workspace
    User's image

    2.Next add the Log Analytics workspace name AVDLaw it has to add to the diagnostics setting like mentioned below image
    User's image

    User's image

    3.Next Setup the Data collection logs before that you need to create storage account to collect logs to send to Log Analytics and create the same region where Log analytics you have created Create an Azure storage account
    User's image

    4.Next Setup Data collection logs go to the host pool and select the session host under monitor section click on diagnostic setting add the previously created storage setting add that extension enable that guest level extension confirm which logs do you want tick check as per below image
    User's image

    5.Next you can add the reader access to read only from resource group level Desktop Virtualization reader
    User's image

    In the same way you can add the for log analytics workspace as Log analytics reader
    User's image

    6.After this setup you can navigate to Log analytics workspace resource you can select predefined query to get the active session and user logins and also customize the queries based on your requirement
    User's image

    If you found this information helpful and my inputs, please click an accepting the answer and don't forget to "Upvote" on my post for other community members referenceUser's image


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.