Hi kavya madda,
Welcome to the Microsoft Q&A Platform. Thank you for posting your query here
Based upon your question, you can follow these steps to find out users who have not accessed Azure Virtual Desktop (AVD) in last 20 days using Azure Monitor and Log Analytics
Prerequisites: - Make sure you have contributor or monitoring Reader permissions on the log analytics workspace is enabled ensure AVD diagnostics are configured to send logs to your log analytics workspace first. Go to the azure monitor and then log analytics workspace. Please refer this document to configure Diagnostic Settings for Azure Virtual Desktop
You can review the logs to track user activity using Kusto Query Language (KQL). To find users who haven’t logged in for at least 20 days, use this query:
AVDActivityLogs
| where TimeGenerated < ago(20d)
| summarize LastSignIn=max(TimeGenerated) by UserPrincipalName
| where LastSignIn < ago(20d)
This query is used to filter the users with last sign-in activity as 20 days older. Review, and export the results as required.
If an answer has been helpful, please consider accepting the answer and "Upvote" to help increase visibility of this question for other members of the Microsoft Q&A community.