Let Telemetry Diagnose Slow VPN Sessions First
Endpoint telemetry classifies slow VPN sessions, identifies the failing layer and triggers safe remediation before support teams investigate.

Underlined words are defined in the KBY Lexicon. Tap or click one to see what it means.
Slow VPN tickets arrive with almost no detail, even though the answers a technician needs already sit on the user’s machine: latency, packet loss, DNS time and the gateway in use. Collecting that data automatically and classifying it removes the back-and-forth before anyone opens the ticket. Four parts do the work: the collector script, a classification webhook, self-heal or escalate rules and the remediation actions.
#The Old Way: Twenty Minutes of Twenty Questions
Every remote-work Monday brings the same flood: dozens of tickets titled some variation of “VPN is slow” or “can’t get anything done, connection is dragging.” The old way of handling this is painfully manual. A technician opens the ticket, reads a one-line description with zero diagnostic detail, and starts the interrogation: What’s your ping? Can you run a tracert?
What client version are you on? Is it slow for everyone in your office, or just you? Are you on Wi-Fi or ethernet? Have you tried restarting the client?
Each question adds a reply-wait cycle. The user is at lunch, or in a meeting, or simply doesn’t know how to run a tracert. Twenty minutes becomes an hour. Multiply that by forty tickets during a regional ISP hiccup or a gateway under load, and an entire shift disappears into the same repetitive diagnostic script that a machine could run in a few seconds.
#Why “My VPN Is Slow” Is the Perfect Ticket to Automate
This ticket type is high-volume, low-variance, and almost entirely diagnosable from telemetry the endpoint already has access to: latency to the gateway, jitter, packet loss, CPU and memory load, DNS resolution time, split-tunnel configuration, and which regional gateway the client is authenticated against. None of that requires a human conversation.
It requires instrumentation, classification, and — in the majority of cases — a scripted fix that takes less time to run than it takes to type “have you tried restarting it?”
The goal isn’t to build a smarter helpdesk agent who asks better questions faster. The goal is to remove the questions entirely by capturing the answers before the ticket exists.
#Step One: Instrument the Endpoint, Not the Technician
The first engineering move is a lightweight telemetry collector that runs the moment a user reports (or a monitoring agent detects) VPN degradation. This can be triggered by a Self-Service Portal button labelled “My VPN Feels Slow” instead of a free-text ticket field. That button runs a script, not a form.
The script below assumes Windows PowerShell 5.1 or PowerShell 7 and handles the different property names that Test-Connection returns (ResponseTime in 5.1, Latency in 7). Note that the VPN server address may be a hostname rather than an IP, so the payload field is called gateway. Test it on a single pilot device first, and only read-only queries are made on the endpoint.
1# Collect-VPNTelemetry.ps1
2$gateway = (Get-VpnConnection | Select-Object -First 1).ServerAddress
3$pings = Test-Connection -ComputerName $gateway -Count 4
4$prop = if ($PSVersionTable.PSVersion.Major -ge 7) { 'Latency' } else { 'ResponseTime' }
5$latency = $pings | Measure-Object -Property $prop -Average
6$dnsTime = Measure-Command { Resolve-DnsName portal.internal.corp }
7$adapter = Get-NetAdapter | Where-Object {$_.Name -match 'VPN|PPP'}
8$splitTunnel = (Get-VpnConnection | Select-Object -First 1).SplitTunneling
9$cpuLoad = (Get-Counter '\Processor(_Total)\% Processor Time').CounterSamples.CookedValue
10
11$payload = @{
12 userId = $env:USERNAME
13 deviceId = (Get-CimInstance Win32_ComputerSystemProduct).UUID
14 gateway = $gateway
15 avgLatencyMs = [math]::Round($latency.Average,1)
16 dnsTimeMs = [math]::Round($dnsTime.TotalMilliseconds,1)
17 adapterUp = $adapter.Status
18 splitTunnel = $splitTunnel
19 cpuPercent = [math]::Round($cpuLoad,1)
20 timestamp = (Get-Date).ToString('o')
21}
22
23Invoke-RestMethod -Uri "https://ai-triage.internal.corp/webhook/vpn" -Method Post -Body ($payload | ConvertTo-Json) -ContentType 'application/json'This typically completes in a few seconds and captures everything a technician would have spent fifteen minutes asking for. No ticket has been logged yet — the data arrives before the complaint does.
#Step Two: Route Telemetry Through an AI Classification Webhook
The webhook receiving this payload doesn’t need a technician on the other end. It needs a lightweight classification layer that scores the telemetry against known root-cause patterns and returns a confidence-rated diagnosis. This can be a fine-tuned small model, a rules engine, or an LLM call constrained to a fixed set of categories — the important part is that it returns structured, actionable JSON, not prose.
1// Incoming payload example
2{
3 "userId": "j.harrow",
4 "deviceId": "a3f9-...",
5 "gateway": "10.20.4.11",
6 "avgLatencyMs": 340,
7 "dnsTimeMs": 890,
8 "adapterUp": "Up",
9 "splitTunnel": false,
10 "cpuPercent": 12,
11 "timestamp": "2025-03-11T09:14:02Z"
12}
13
14// Classifier response
15{
16 "diagnosis": "DNS_RESOLUTION_BOTTLENECK",
17 "confidence": 0.94,
18 "recommendedAction": "FLUSH_DNS_AND_REBIND",
19 "escalate": false,
20 "reasoning": "DNS time 890ms exceeds 200ms threshold while latency and CPU are nominal"
21}Note the structure: a diagnosis code, a confidence score, a specific recommended action, and an explicit escalate flag. This is the contract between the AI layer and the automation layer — no ambiguity, no need for a human to interpret a paragraph of AI-generated text under time pressure.
#Step Three: Build the Decision Logic — Self-Heal or Escalate
Confidence score drives everything downstream. High confidence on a known, low-risk fix triggers automatic self-healing, but only for actions on an explicitly approved list, first on a pilot group of devices and then in stages. Remediation is rate-limited per time window, halts automatically if failures spike, and can be stopped at any time with a global off switch.
Medium confidence creates a ticket that arrives at L1 already diagnosed, with the fix suggested but not auto-applied. Low confidence, or any diagnosis tagged as infrastructure-side (gateway overload, regional outage), escalates straight to L3 with the raw telemetry attached, skipping L1 entirely.
Rules are evaluated in order and the first match wins, so infrastructure diagnoses are checked before anything else.
1{
2 "rules": [
3 { "diagnosis_in": ["GATEWAY_SATURATION", "REGIONAL_OUTAGE"], "action": "ESCALATE_L3" },
4 { "confidence_gte": 0.90, "risk": "low", "action_in_approved_list": true, "action": "AUTO_REMEDIATE" },
5 { "confidence_gte": 0.70, "action": "CREATE_TICKET_PREFILLED" },
6 { "default": true, "action": "CREATE_TICKET_UNSCORED" }
7 ]
8}The rule set is deliberately simple and version-controlled like any other piece of infrastructure. Anything that is high confidence but not low risk or not on the approved list falls through to a prefilled ticket, and anything below 0.70 hits the single default rule. When a new failure mode appears — say, a firmware bug on a specific VPN client build — you add a rule and a remediation script rather than retraining an entire model from scratch.
#Step Four: Automate the Remediation Actions
Each recommended action maps to a pre-approved script sitting in your RMM tool. These aren’t experimental — they’re the same fixes a competent technician would run, just executed instantly and consistently. Pilot each script on a small group before widening the scope; the DNS cache flush below is harmless to repeat and is undone simply by the cache repopulating.
1# Remediate-DNSBottleneck.ps1
2# Global off switch: do nothing if the kill switch is set
3if (Test-Path 'HKLM:\SOFTWARE\Corp\AutoRemediation\Disabled') { Write-Output "REMEDIATION_DISABLED"; return }
4
5# Low-impact fix: flush the DNS client cache without touching the VPN session
6Clear-DnsClientCache
7
8# Verify fix
9$check = Measure-Command { Resolve-DnsName portal.internal.corp }
10if ($check.TotalMilliseconds -lt 200) {
11 Write-Output "REMEDIATION_SUCCESS"
12} else {
13 Write-Output "REMEDIATION_FAILED_ESCALATE"
14}The script self-verifies, but it only writes its result to output. You must wire that output into your RMM or webhook so that it is consumed: on REMEDIATION_SUCCESS the automation proceeds to the notification step, and on REMEDIATION_FAILED_ESCALATE it opens a ticket that includes both the original telemetry and the fact that an automated remediation was already attempted and failed.
That single detail saves a technician from repeating the first diagnostic step. Until that wiring is built and tested, a failed fix will not escalate on its own.
#Step Five: Close the Loop Without a Human Touch
Once remediation succeeds, the system notifies the user directly — via Teams, Slack, or email — and logs a closed, informational ticket for audit purposes. No queue entry, no SLA clock started, no technician touch.
1{
2 "channel": "teams-dm",
3 "recipient": "j.harrow@corp.com",
4 "message": "We noticed your VPN connection was slow due to a DNS resolution issue and fixed it automatically. If you're still experiencing slowness, reply here to open a ticket with a technician.",
5 "ticketRef": "AUTO-88213",
6 "status": "resolved_automated"
7}The reply-to-open-ticket fallback matters. Automation should never trap a user with no human escalation path — it just moves that path to be the exception rather than the default.
#Step Six: Feed the Loop — Continuous Learning
Every auto-remediation attempt, successful or not, gets logged with its outcome. This becomes the training set for tightening confidence thresholds and catching new failure patterns. If “REMEDIATION_FAILED_ESCALATE” starts appearing frequently for a specific diagnosis code, that’s a signal the underlying rule or script needs revision, not that the AI layer is untrustworthy.
1{
2 "diagnosis": "DNS_RESOLUTION_BOTTLENECK",
3 "attempts": 214,
4 "successRate": 0.91,
5 "avgResolutionSeconds": 4.2,
6 "escalatedAfterFailure": 19
7}Review this weekly. A 91% success rate on 214 attempts means roughly 195 tickets were resolved by the script’s own check. Note that this check only measures DNS resolution time, not the user’s actual VPN experience, so confirm through user follow-up (for example, whether they replied to the notification) before treating those as fully resolved. That is still the number to put in front of management when justifying the engineering time spent building this.
#What This Means for Your Queue
Before this pipeline existed, a mid-size organisation might log 60 to 100 “VPN slow” tickets a week during peak remote periods, each consuming 15 to 40 minutes of technician time for diagnosis alone, before any actual fix.
After deployment, the overwhelming majority resolve in under five seconds with zero human involvement, and the tickets that do reach a technician arrive pre-diagnosed with root cause, confidence score, and failed remediation attempts already attached. The technician’s job shifts from detective to specialist — dealing only with the genuinely unusual cases that the automation correctly identified as needing a human.
#Handing Control Back to L1: When to Override the Bot
Automation like this needs a visible kill switch. Technicians should be able to see, in real time, which users had an automated remediation attempted, what action was taken, and whether it succeeded — ideally in the same dashboard used for manual tickets.
If a technician spots a pattern the classifier is missing (a new client version behaving oddly, for instance), they should be able to flag the diagnosis as incorrect directly from the ticket, which feeds back into the training set.
The technician isn’t replaced by this system; they become the person who tunes the system’s judgement over time, catching edge cases the confidence thresholds haven’t learned yet.
The measure of success here isn’t a flashy AI headline. It’s a queue that’s quieter on Monday morning because the fifteen-minute interrogation ritual has been replaced by a script that already knew the answer before the user finished typing the ticket title.
#Related reading
VPN
Building Site-to-Site VPN Failover Between Branch and AWS
Ending VPN Split-Tunnel Break Fixes With Auto-Profile Repair
AWS Site-to-Site VPN Tunnel Down After BGP Flap to Azure: Fix
About this page
Credited to
Dates
Published
Sources
Found this useful? Follow KBY for more like it.
Recommended reading
More from KBY that goes with this article.
Related articles
The AI Helpdesk
Teams Rooms Speaker Recognition: Make Copilot Recaps Name Who Spoke, Not the Room
Copilot recap credits Conference Room 1 instead of people? Check the Teams Rooms Pro licence, device voice recognition, voice enrolment and the meeting policy.
ReadThe AI Helpdesk
Triage Copilot Tickets by Finding Which Copilot the User Has
Which Copilot does a user have? Check the signed-in account, the M365_COPILOT_BUSINESS_CHAT plan with Get-MgUserLicenseDetail and any tenant block.
ReadConsumer tech
Oura Ends Android 11 Support on 8 December: What Android Users Should Do
Oura says Android 11 support ends on 8 December, and a later upgrade will not carry your history over. How to check your phone and what to do first.
ReadConsumer tech
GTA 6’s First Update Fixes Lost Autosaves and Mission Bugs on PS5 and Xbox
Rockstar's first GTA 6 patch fixes failing autosaves, missed mission calls and static weather. PS Plus Premium can now also stream the game to a PS5 or PlayStation Portal.
ReadDiscover more
Graduate Learning
Lexicon Definitions
Was this useful?
Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.
Operate smarter, with fewer recurring tickets.
Receive new operational playbooks, incident-prevention guidance, automation scripts and recovery runbooks.


Comments
Add a thoughtful note on Let Telemetry Diagnose Slow VPN Sessions First. Comments are checked for spam and held for moderation before appearing.