Forum Discussion
JonKilner
Dec 14, 2022Brass Contributor
KQL to report on user login duration
We are seeing an issue with login delays for users, whereby it sometimes takes many minutes for a user to be presented with a desktop. As part of troubleshooting this issue, I'd like to create a ...
DaveMeijer
Jul 18, 2023Copper Contributor
Hello JonKilner
Do you have solved the problem.
I use this code;
WVDConnections
| where TimeGenerated > ago(24h)
| where State == "Started"
| where SessionHostName has "<SessionHostName>"
| project CorrelationId, UserName, ConnectionType, StartTime=TimeGenerated, _ResourceId
| join (WVDConnections
| where State == "Connected"
| project EndTime=TimeGenerated, CorrelationId)
on CorrelationId
| project Duration = EndTime - StartTime, UserName, _ResourceId
| summarize AvgDuration=avg(Duration) by _ResourceId, Username
| extend Multi=split(_ResourceId, "/")
| project AvgDuration, ResourceGroup=Multi[4], HostPool=Multi[8]
| sort by AvgDuration desc
| where AvgDuration > timespan(00:01:00)