Fixing Windows 11 24H2 – No Internet Access Issue using PowerShell and Intune Remediation

There are articles and forum posts from people who upgraded to Windows 11 24H2 and are experiencing Wi-Fi issues. In this blog post, I will show you an Intune Remediation script that might fix the problem for your devices.

24h2 Wi-Fi issue?

“If you’ve upgraded to Windows 11 version 24H2 recently and found yourself staring at a “No Internet Access” warning, you’re not alone. A lingering bug in Microsoft’s latest Windows 11 update has left countless PCs struggling to connect to Wi-Fi networks properly, with a crippling DHCP issue at its core. Let’s unpack what’s going on, why this is a big deal, and what (if anything) you can do about it.


The crux of the problem lies in how Windows 11 24H2 communicates with DHCP servers. DHCP (Dynamic Host Configuration Protocol) is what assigns an IP address to your device, enabling it to connect to the internet. But ever since this update rolled out, numerous users are reporting that their PCs aren’t getting a valid IP address through DHCP. Instead, they’re receiving an Automatic Private IP Address (APIPA) — essentially a random, self-assigned IP address that has all the connectivity prowess of a stone-age modem. If your PC pulls an APIPA address, it means it can’t communicate with the DHCP server, resulting in no internet access.”

Source: https://windowsforum.com/threads/fixing-windows-11-24h2-no-internet-access-issue-dhcp-troubles-explained.348708/

Remediation?

Microsoft Intune has a solution called Remediation (More information here: Remediations | Microsoft Learn), consisting of Detection and Remediation scripts. The Detection script will check, at intervals, if your machine has a specific setting, value, piece of software, etc, and will start the Remediation script for you to fix that. After that runs, it will continue checking. (This is different from using Platform Scripts. These will run until successfully executed and never again).

Note: Proactive Remediations are only available for customers with the following licenses:

– Windows 10/11 Enterprise E3 or E5 (included in Microsoft 365 F3, E3, or E5)
– Windows 10/11 Education A3 or A5 (included in Microsoft 365 A3 or A5)
– Windows 10/11 Virtual Desktop Access (VDA) per user

How do the scripts work to fix this issue?

One solution to the issue is removing the “WinHTTPAutoProxySvc” (WinHTTP Web Proxy Auto-Discovery Service) service dependency from the Windows Connection Manager service. You can do that manually by editing the Registry, but that’s why we have Intune, right? 🙂

The scripts will do that for you. The Detection script will check if the “WinHTTPAutoProxySvc” value is present in the “DependOnService” key inside this Registry path: HKLM\System\CurrentControl\SetServices\WcmSvc and if the “WinHttpAutoProxySvc” service is configured to be Manual. The Remediation script will remove that value and restart the “Windows Connection Manager” and WLAN AutoConfig” services after configuring the “WinHttpAutoProxySvc” service to be Manual instead of Disabled.

The Detection script

Below are the contents of the Detection script; it will exit with exit code 0 when everything is ok. It will exit with exit code 1 if the service is still in the “DependOnService” key and tell Intune to start running the Remediation script.

#Check Registry
if ((Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Services\Wcmsvc | Select-Object -ExpandProperty DependOnService) -contains "WinHTTPAutoProxySvc") {
    Write-Output "WinHTTPAutoProxySvc key found in HKLM:\SYSTEM\CurrentControlSet\Services\Wcmsvc, needs Remediation"
    $remediation = $true
}
else {
    Write-Output "WinHTTPAutoProxySvc key not found in HKLM:\SYSTEM\CurrentControlSet\Services\Wcmsvc, no need for Remediation"
    $remediation = $false
}

#check service
if ((Get-Service -Name WinHttpAutoProxySvc).StartType -ne 'Manual') {
    Write-Output "WinHTTP Web Proxy Auto-Discovery Service not configured as Manual, needs Remediation"
    $remediation = $true
}
else {
    Write-Output "WinHTTP Web Proxy Auto-Discovery Service configured as Manual, no need for Remediation"
    $remediation = $false
}

#exit with correct exit code
if ($remediation) {
    exit 1
}
else {
    exit 0
}

The Remediation Script

Below are the contents of the Remediation script. It will remove the “WinHTTPAutoProxySvc” value from the “DependOnService” key and restart the “Windows Connection Manager” and WLAN AutoConfig” services after configuring the “WinHttpAutoProxySvc” service to be Manual instead of Disabled.

#Change Dependency
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\Wcmsvc -Name DependOnService -Value @('RpcSs', 'NSI') -Type MultiString

#Set Service WinHttpAutoProxySvc to Manual
New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\WinHttpAutoProxySvc -Name 'Start' -Value '3' -PropertyType DWORD -Force:$true

#Restart services
Restart-Service WcmSvc, WlanSvc -Force:$true -Confirm:$false

Adding the scripts to Intune

You can follow these steps to add the scripts to Intune:

  • Go to Devices – Microsoft Intune admin center
  • Select Create
  • Fill in the details (Name, Description, Publisher) and select Next
  • Select the folder icon next to the Detection script file line, browse, and select the Detection.ps1 file.
  • Select the folder icon next to the Remediation script file line, browse, and select Detection.ps1 file.
  • Make sure that Run this script using the logged-on credentials button is set to No
  • Select Next
  • Select Next
  • Click Select groups to include, select the desired group, and click Select.
  • Select Daily in the Schedule column and configure the Frequency to OnceHourly, or Daily and select Apply
  • Select Next and Create to complete adding the Remediation scripts to Intune.

Testing the scripts

If you have a device in your environment with Wi-Fi issues, run the Detection and Remediation script manually on that machine. If it works, add more devices to the group specified in the chapter above and continue until all devices are added. (You could filter for devices running Windows 11 24H2 specifically, of course)

Note: The devices that experience issues with Wi-Fi must be connected using ethernet, of course 😉

Wrapping up

In this blog post, I showed how to remediate the Windows 11 24H2Wi-Fi issue (if your users are experiencing it) using a Microsoft Intune Remediation script solution. This will help until Microsoft solves the problem. Please monitor your newsfeeds for that and stop using this Remediation approach then.

You can also download the script(s) from GitHub here.

2 thoughts on “Fixing Windows 11 24H2 – No Internet Access Issue using PowerShell and Intune Remediation

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.