How to get the list of users who are not logged into the azure virtual desktop under a hostpool for 20 or more than 20 days ?

kavya madda 60 Reputation points
2024-09-06T17:17:20.58+00:00

Hi i want to know how can we get the list of users who are not logged into AVD from past 20 o more than 20 days either they may be left from project or organization or still in project but not using it .

what are the prerequisites for that i needed & level of accesses ?

What are the ways i can achieve it?

what is the best way to do it ?

thanks in Advance

Azure Virtual Desktop
Azure Virtual Desktop
A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
1,523 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,469 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sai Krishna Katakam 145 Reputation points Microsoft Vendor
    2024-09-06T23:36:50.63+00:00

    Hi kavya madda,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    To get the list of users who have not logged into Azure Virtual Desktop (AVD) under a host pool for 20 or more days, you can follow these steps:

    Prerequisites:

    • Ensure that Log Analytics Workspace is set up and connected to AVD.
    • You need Desktop Virtualization Reader role on the host pool and Reader or Contributor role on Log Analytics Workspace.
    • Enable audit logs for user sessions in AVD by setting up Diagnostic Settings.

    Steps to Achieve This:

    • Enable Log Analytics for AVD by configuring diagnostic settings to forward AVD session host logs to your Log Analytics workspace. You can refer to this guide for setup: Azure Monitor diagnostics settings.
    • Query Log Analytics with this Kusto query to find users who haven't logged in for the last 20 days:
    WVDConnections
    | where TimeGenerated > ago(30d) 
    | summarize lastLogin=max(TimeGenerated) by UserName
    | where lastLogin < ago(20d)
    

    For more information, please refer to this guide: Enable Insights to monitor Azure Virtual Desktop.

    If you have any further queries, do let us know. If the comment is helpful, please click "Upvote".


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.