Forum Discussion

PuneetAg_'s avatar
PuneetAg_
Copper Contributor
May 15, 2023

How to use Log Analytics Workspace to identify Personal VM's which are not in use from last 30d

We want to identify and delete personal VM's which do not have any logins from their assigned users

2 Replies

  • PuneetAg_ 

    Last logon is :

     

    SecurityEvent
    | where TimeGenerated > ago(30d)
    | where EventID in (4624) // An account was successfully logged on.
    | summarize count(), arg_max(TimeGenerated, *) by EventID, Activity , Computer, LogonTypeName, Account

Resources