Forum Discussion
garymansell
Jun 07, 2021Brass Contributor
Is there a KQL Query to detect Session hosts that are in drain mode (not accepting new sessions)?
Hi, I have setup an Azure function to lookout for problem WVD session hosts (VMs running for more that 15 mins but not available in the host pool), which then shuts them down and sets Drain mode ...
rajshatru
Sep 19, 2024Copper Contributor
Try this
Try this, this will list out the session hosts which are in Drained state and not allowingnewsessions. Set the status to Unavailable and it will list out the session hosts which are under Can't connect status
WVDAgentHealthStatus
| where SessionHostHealthCheckResult contains "available"
| join WVDAgentHealthStatus on AllowNewSessions
| where AllowNewSessions contains "False"
Try this, this will list out the session hosts which are in Drained state and not allowingnewsessions. Set the status to Unavailable and it will list out the session hosts which are under Can't connect status
WVDAgentHealthStatus
| where SessionHostHealthCheckResult contains "available"
| join WVDAgentHealthStatus on AllowNewSessions
| where AllowNewSessions contains "False"