Automate the troubleshooting of network issue caused by Windows 11 24H2 Update
After upgrading to Windows 11 24H2, some computer clients cannot access network via LAN or WLAN because of missing network gateway that the DHCP server cannot request. Manually typing the gateway does not help neither because it is lost again after system restart.
Bear in mind that this internet disconnection issue is caused by a Windows 11 24H2 update from Microsoft, and this is not an issue with your internet router.
The following is a PowerShell script to automate the following steps:
To use this script:
领英推荐
Features:
#Requires -RunAsAdministrator
<#
.SYNOPSIS
Resolves Windows 11 24H2 update-related internet connectivity issues by modifying service dependencies and restarting affected services.
#>
try {
$regPath = "HKLM:\System\CurrentControlSet\Services\WcmSvc"
$valueName = "DependOnService"
# Check if the registry value exists
if (-not (Get-ItemProperty -Path $regPath -Name $valueName -ErrorAction SilentlyContinue)) {
Write-Warning "DependOnService entry not found in WcmSvc registry key."
exit 1
}
# Get current dependencies and remove WinHTTPAutoProxySvc
$currentValues = Get-ItemPropertyValue -Path $regPath -Name $valueName
$newValues = $currentValues | Where-Object { $_ -ne 'WinHTTPAutoProxySvc' }
# Update registry if changes are needed
if ($newValues.Count -ne $currentValues.Count) {
Set-ItemProperty -Path $regPath -Name $valueName -Value $newValues
Write-Host "Successfully updated DependOnService entries." -ForegroundColor Green
}
else {
Write-Host "WinHTTPAutoProxySvc dependency not found - no changes made." -ForegroundColor Yellow
}
# Restart Windows Connection Manager service
Restart-Service -Name WcmSvc -Force
Write-Host "Windows Connection Manager service restarted successfully." -ForegroundColor Green
}
catch {
Write-Error "An error occurred: $_"
exit 1
}