Ending VPN Split-Tunnel Break Fixes With Auto-Profile Repair
A proactive remediation pipeline detects VPN split-tunnel route drift and rebuilds profiles automatically before users ever log a ticket.

This playbook covers
Table of Contents
Table of contents
#The Old Way vs The New Way
The old way of handling broken split-tunnel VPN profiles looks like this: a remote worker cannot reach an internal file share, the technician remotes in, opens the VPN client, deletes the profile, re-imports a golden XML config from a shared drive, restarts the adapter, and prays the routing table rebuilds correctly. Multiply that by every laptop that drifted after a Windows update reset an adapter metric or a conflicting local VPN client injected its own routes. It is thirty minutes of manual routing table archaeology per incident, and it recurs weekly across a large fleet.
The new way treats a broken split-tunnel profile as a state-drift problem, not a support ticket. A scheduled remediation script compares the live routing table and VPN client configuration against a known-good baseline, rewrites the profile automatically, and reports back through your RMM or Intune proactive remediation channel before the user notices anything is wrong.
#Prerequisites and Permissions
- Endpoints enrolled in Microsoft Intune (or equivalent MDM/RMM with script deployment) with Proactive Remediations enabled.
- VPN client supports command-line profile export/import (this example uses the native Windows VPN client via PowerShell; adapt cmdlets for Cisco AnyConnect or GlobalProtect using their CLI utilities).
- A signed, version-controlled baseline profile XML stored in an access-controlled repository (Azure Blob with SAS token or an internal package share).
- Minimum role: Intune Endpoint Security Administrator or equivalent RMM script-deployment role. No local admin rights should be granted to end users.
- Test scope: pilot on a device collection of 15 to 25 machines from a single region before fleet-wide deployment.
#Why Drift Happens in the First Place
Before building the remediation pipeline it is worth understanding what actually corrupts a split-tunnel profile, because the detection logic is only as good as the failure modes it anticipates. The four most common causes observed across managed fleets are Windows feature updates that reset network adapter bindings and metrics, third-party VPN or SD-WAN clients that install their own routing table entries with a lower metric and silently win the route, group policy
#Implementation Steps
- Action: Export the current known-good VPN profile as the baseline. Run
Get-VpnConnection -Name "CorpVPN" | Export-Clixml -Path "C:BaselineCorpVPN.xml"on a healthy reference machine.
Expected result: A clean XML file containing split-tunnel routes, DNS suffixes and authentication settings.
Evidence: File hash recorded in your configuration repository changelog. - Action: Write the detection script that compares live route count and DNS suffix list against baseline values, exiting with code 1 if drift is detected.
Expected result: Script correctly flags a deliberately broken test profile.
Evidence: Intune Proactive Remediation detection log showing non-compliant status. - Action: Write the remediation script (below) and package both as an Intune Proactive Remediation pair.
Expected result: Non-compliant devices auto-repair on the next scheduled run (default every hour).
Evidence: Remediation output log entryVPN profile repaired: routes restored to 4, DNS suffix corrected. - Action: Deploy to the pilot group and monitor for 5 business days.
Expected result: Zero new VPN routing tickets from pilot devices.
Evidence: Ticket volume report filtered by device collection tag. - Action: Roll out to the full fleet in rings of 20 percent per day.
Expected result: Steady decline in split-tunnel related tickets across each ring.
Evidence: Weekly ticket category trend chart. - Action: Configure the baseline repository access policy so the SAS token or share credential used by the remediation script is scoped to read-only and rotated on the same cadence as other automation secrets.
Expected result: Script continues functioning after rotation with no manual intervention beyond updating the stored credential reference.
Evidence: Credential rotation log entry cross-referenced against successful remediation runs in the following cycle. - Action: Add a lightweight local log write (for example to
C:ProgramDataVpnRemediationhistory.log) each time the remediation script runs, independent of the Intune reporting channel.
Expected result: A local audit trail exists even if Intune reporting is delayed or unavailable.
Evidence: Log file showing timestamped entries for each detection and remediation cycle on a sample device.
#Detection Script (PowerShell)
1$baseline = Import-Clixml -Path "C:BaselineCorpVPN.xml"
2$current = Get-VpnConnection -Name "CorpVPN" -ErrorAction SilentlyContinue
3if (-not $current) { Write-Output "VPN profile missing"; exit 1 }
4$routeCount = (Get-VpnConnectionRoute -ConnectionName "CorpVPN").Count
5if ($routeCount -ne $baseline.RouteCount -or $current.DnsSuffix -ne $baseline.DnsSuffix) {
6 Write-Output "Drift detected: routes=$routeCount expected=$($baseline.RouteCount)"
7 exit 1
8} else {
9 Write-Output "VPN profile healthy"
10 exit 0
11}#Remediation Script (PowerShell)
1Remove-VpnConnection -Name "CorpVPN" -Force -ErrorAction SilentlyContinue
2$baseline = Import-Clixml -Path "C:BaselineCorpVPN.xml"
3Add-VpnConnection -Name "CorpVPN" -ServerAddress $baseline.ServerAddress -TunnelType $baseline.TunnelType -SplitTunneling -AuthenticationMethod $baseline.AuthenticationMethod -Force
4foreach ($route in $baseline.Routes) {
5 Add-VpnConnectionRoute -ConnectionName "CorpVPN" -DestinationPrefix $route -PassThru
6}
7Write-Output "VPN profile repaired: routes restored to $($baseline.Routes.Count), DNS suffix corrected"
8exit 0#Verification and Expected Evidence
| Check | Command | Expected Output |
|---|---|---|
| Route count | Get-VpnConnectionRoute -ConnectionName "CorpVPN" | 4 destination prefixes matching baseline |
| DNS suffix | Get-VpnConnection -Name "CorpVPN" | Select DnsSuffix | corp.internal |
| Remediation log | Intune device compliance blade | Status: Remediated, timestamp within last hour |
| Local audit trail | Get-Content C:ProgramDataVpnRemediationhistory.log -Tail 10 | Chronological entries with no gaps longer than the scheduled interval |
| Credential validity | Repository access test from a pilot device | HTTP 200 or successful file read, no authentication failure |

#Rollback
If the remediation script causes unintended connectivity loss, disable the Proactive Remediation assignment immediately, then push a targeted script to run Remove-VpnConnection -Name "CorpVPN" -Force followed by manual re-import of the last known-good XML from the pre-automation era. Blast radius is limited to the assigned device collection, never the full tenant, because rings are staged. Before re-enabling the assignment, isolate the root cause by comparing the baseline XML hash against the version recorded at pilot sign-off; a silent baseline edit is the most common cause of a rollback event, since anyone with write access to the repository share can inadvertently push a stale or malformed profile that the remediation script then propagates fleet-wide on its next cycle. Treat the baseline file with the same change-control discipline as a production configuration file, including mandatory peer review before any update.
#Failure and Escalation Conditions
Wake a human technician when the same device fails remediation three consecutive cycles, when detection scripts report a missing baseline file (indicating repository access failure), or when remediation success is logged but users still report connectivity loss, which suggests a firewall or conditional access policy change unrelated to the VPN profile itself. Monitor via the Intune remediation success-rate dashboard; a drop below 90 percent success across a ring should pause further rollout. Escalation should also trigger automatically if the local audit log on a device shows a gap exceeding three scheduled cycles, since this typically indicates the Intune management agent itself has stopped checking in rather than a VPN-specific fault, and no amount of profile repair will resolve an agent communication failure. In that scenario the ticket should be routed to endpoint management rather than the network team, and the routing rule should be documented in the runbook so first-line triage does not misclassify the incident.
#Change Control and Governance
Every update to the baseline XML, the detection script, or the remediation script should go through the same change advisory process as any other production automation: a named owner, a documented reason for change, a dated pilot re-run on the 15 to 25 machine test collection, and a rollback plan captured before the change is approved. Version the baseline file using a naming convention that embeds the date and a short description, for example CorpVPN_2026-03-14_split-tunnel-v3.xml, and retain at least the previous three versions in the repository so a regression can be traced to the exact change that introduced it. Assign a quarterly review of the detection thresholds themselves; route counts and DNS suffixes that were correct at initial deployment can become stale as the corporate network topology evolves, and a detection script comparing against an outdated baseline will generate false positives that erode trust in the automation and increase ticket volume rather than reducing it.
#Measuring Ticket Deflection
Rendering diagram...
Track before-and-after ticket counts tagged “VPN routing” or “split-tunnel” over a rolling four-week window. A well-tuned baseline and hourly detection cycle typically removes 70 to 85 percent of this ticket category within the first month, since most drift is caused by predictable events like Windows updates or conflicting client installs rather than genuine network faults. Beyond raw ticket counts, track mean time to resolution for the residual tickets that do reach a technician; because the automation absorbs routine drift, the tickets that remain are disproportionately the genuinely complex cases, so resolution time per ticket may rise even as total volume falls, and reporting both figures together prevents a misleading impression that service quality has declined. It is also worth recording the proportion of remediation runs that detect drift at all; a healthy fleet on a mature baseline should see drift rates settle below 5 percent of scheduled runs once the initial wave of legacy misconfiguration has been cleared, and a sustained rise above that figure across multiple rings is itself a leading indicator worth investigating, often pointing to a newly deployed application or a Windows update ring that is systematically breaking the adapter configuration.

Full reference material for building and testing these remediation pairs is available in Microsoft’s Intune Proactive Remediations documentation and the underlying cmdlets are documented in the VpnClient PowerShell module reference. Once this pipeline is running, split-tunnel VPN routing becomes a self-healing baseline problem rather than a recurring interrupt for the desktop team, freeing technician time for issues that genuinely need a human. The broader lesson for any operations team maintaining this kind of automation is that the value comes not from the cleverness of the scripts themselves but from treating the baseline configuration as a governed artefact with the same rigour applied to source code, because a remediation pipeline is only trustworthy for as long as the thing it repairs towards is known to be correct.
#Operational Context
The remediation pipeline described operates independently of the VPN tunnel itself, which is a structural precondition worth stating explicitly: Intune management traffic and Proactive Remediation script delivery travel over the device's normal internet-facing management channel, not through the corporate VPN tunnel being repaired. This matters because a device with a fully broken VPN profile still needs to be internet-reachable and checked in to Intune for the hourly detection cycle to fire at all. On devices that have gone fully offline, lost their Intune enrollment token, or sit behind a captive portal, the remediation pair cannot run, and this failure mode should be distinguished from a VPN-specific fault during triage.
Scheduling interacts with other endpoint lifecycle events that are not visible from the remediation script alone. Windows feature updates typically install and reboot outside business hours, and if the Proactive Remediation schedule and the update maintenance window overlap, a device may report a detection failure immediately after reboot simply because network adapter bindings have not yet settled. Environments running this pipeline alongside other Proactive Remediations (disk cleanup, certificate renewal, printer mapping) should confirm there is no scheduling collision that causes multiple scripts to modify network state on the same maintenance cycle, since PowerShell VPN cmdlets executing concurrently with adapter-level changes from another script can produce transient false positives that are difficult to reproduce after the fact.
Multi-site and multi-region deployments introduce a further variable not addressed by a single baseline file: split-tunnel route lists frequently differ by site due to local subnet advertisement, meaning a single CorpVPN.xml baseline is only valid for devices sharing the same target network topology. Organisations extending this pattern beyond a single office or region should verify whether multiple baseline variants keyed by site tag or Entra ID group membership are required, and confirm this against their own routing architecture before fleet-wide rollout, since applying a single-site baseline against a different site's device collection would itself constitute a drift-inducing change.
From a service management perspective, the ticket category used for deflection reporting should be reconciled with whatever taxonomy the ITSM platform already uses for network incidents, so that before-and-after comparisons are measuring the same underlying ticket population rather than a redefined category that only exists after the automation was introduced. Where the helpdesk operates in shifts across time zones, the three-consecutive-cycle escalation threshold described elsewhere in this workflow should be checked against the on-call handover schedule to confirm that an escalation raised near a shift boundary is not silently absorbed.
- Verify Intune management channel reachability is independent of the VPN tunnel in your specific network architecture before relying on remote remediation for VPN-down devices
- Check for scheduling overlap between this remediation pair and other Proactive Remediations or patch maintenance windows on the same device collection
- Confirm whether a single baseline file is valid across all deployment sites or whether site-specific baseline variants are required
- Reconcile the ticket taxonomy used for deflection measurement with the existing ITSM category structure to avoid comparing mismatched ticket populations
Evidence trail
Sources and verification
Primary documentation and external technical references used in this article.
Comments
Add a thoughtful note on Ending VPN Split-Tunnel Break Fixes With Auto-Profile Repair. Comments are checked for spam and held for moderation before appearing.
Related articles
Device Management
Stopping Silent Profile Failures with Declarative Management
Declarative device management status subscriptions let macOS fleets auto-detect and remediate silent profile failures before users open a ticket.
Systems Engineering
Postgres Replication Slot Bloat: Root Causes & Fixes
WAL retention math, pg_replication_slots monitoring, and max_slot_wal_keep_size tuning to stop replication slot bloat from filling pg_wal to disk.
Enterprise IT Management
Continuous Control Monitoring for SOC 2 Audits
How AWS Config, Okta logs and GitHub audit events feed a continuous control monitoring pipeline that replaces manual SOC 2 evidence pulls.
Discover more
Learn More About KBY
About KBY
Learn about our mission, editorial standards, and commitment to trusted engineering knowledge.
Why Trust KBY
Explore the processes and policies that ensure our publications are accurate, useful, and responsible.
Newsletter
Get our latest editorial publications, research and practical insights sent directly to your inbox.
Was this useful?
Operate smarter, with fewer recurring tickets.
Receive new operational playbooks, incident-prevention guidance, automation scripts and recovery runbooks.