Skip to content

Correctly detect AutoConfigURL on managed Windows systems#85

Open
pbourguignon-enertrag wants to merge 2 commits intocarsonyl:masterfrom
pbourguignon-enertrag:mdm-correct-autoconfigurl-detection
Open

Correctly detect AutoConfigURL on managed Windows systems#85
pbourguignon-enertrag wants to merge 2 commits intocarsonyl:masterfrom
pbourguignon-enertrag:mdm-correct-autoconfigurl-detection

Conversation

@pbourguignon-enertrag
Copy link

On Windows systems managed by an MDM (e.g. InTune), the value of AutoConfigURL might be found under a different key in the registry, namely HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings. This changeset ensures that the URL is found successfully in such situations.

On Windows systems managed by an MDM (e.g. InTune), the value of AutoConfigURL might be found under a different key in the registry, namely `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings`. This changeset ensures that the URL is found successfully in such situations.
@pbourguignon-enertrag pbourguignon-enertrag changed the title Correctly detect AutoConfigUrl on managed systems Correctly detect AutoConfigURL on managed systems Feb 28, 2026
@pbourguignon-enertrag pbourguignon-enertrag changed the title Correctly detect AutoConfigURL on managed systems Correctly detect AutoConfigURL on managed Windows systems Mar 1, 2026
@carsonyl
Copy link
Owner

carsonyl commented Mar 2, 2026

Thanks for the PR. While looking into this, I found https://learn.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-ie-clientnetworkprotocolimplementation-hklmproxyenable, which suggests the selection of HKCU/HKLM depends on ProxySettingsPerUser. Is that true in your situation?

@pbourguignon-enertrag
Copy link
Author

You're very welcome!

Indeed, under the path Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings, I do have the key ProxySettingsPerUser with a value of 0.

Then, under Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings, I actually have ProxyEnable set to 0 alongside AutoConfigURL set to the URL of the PAC file. It looks like ProxyEnable is set to 1 when a fixed proxy server is defined via (HKCU|HKLM)ProxyServer and ``(HKCU|HKLM)ProxyPort`, but not when a PAC file is in use. That's at least what Copilot claims, but I haven't found a clear statement in the Microsoft docs that clarifies that point.

Anyway, the PR could rely on a lookup of ProxySettingsPerUser rather than catching the exception. Before I proceed, could you confirm that this key also exists on non-managed Windows systems?

@carsonyl
Copy link
Owner

On my own PC, HKLM\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings doesn't have ProxySettingsPerUser at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants