What NTLite component is tied to "Random hardware addresses"?

tted

Member
Messages
38
Reaction score
8
Basically, if "Use random hardware addresses" is ON you get a can't connect to the network error.
Then you you Admin CMD:
ipconfig /flushdns
netsh winsock reset

Restart your computer
Open settings -> Network and Internet -> Network Reset

Restart your computer and Bang, you can connect to your wireless network as long as "Use random hardware addresses" has never been turned ON and is OFF.
This is an annoying problem.
What do I keep in Ntlite to prevent that function from breaking or what files do I protect?

Windows 10 21H2 LTSC 2021

View attachment 12884
 
Unfortunately, the setting for Wi-Fi random HW addresses is kept on a per-network adapter basis.

Which means you can't disable it until your Wi-Fi network device is configured. But you can run a PowerShell script from Post-Setup (Before logon), and turn the setting off.

Script to Disable "Use Random MAC Addresses" for wifi

Copy as DisableRandomMAC.ps1:
Code:
try {
    $Adapter = Get-NetAdapter | Where-Object PhysicalMediaType -eq 'Native 802.11'
    $RegPath = 'HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}'
    $Key = Get-ItemProperty -Path "$RegPath\*" -Name 'AdapterModel' -ErrorAction SilentlyContinue
    if ($Key.AdapterModel -eq $Adapter.InterfaceDescription) {
        New-ItemProperty -Path "$RegPath\$($Key.PSChildName)" -Name 'NetworkAddress' -Value $($Adapter.MacAddress) -PropertyType String -Force
    }
    exit 0
} catch {
    $_.Exception.Message
    exit 1
}
 
Not exactly what I wanted, but kind of like finding a needle in a haystack I guess so your alternative is helpful.

Thank you.
 
There isn't a separate feature for it, the base functionality is probably hidden inside the WLAN device support.

Settings App doesn't do anything except to tweak some Wi-Fi device reg keys. The actual work is done at the network driver level, and there is no other way it's exposed to the end user. Since the device driver tree is dynamically created with random GUID's, you can't use a reg file, because you don't know them in advance.

Is it really stupid Windows didn't make a "netsh wlan" command for this setting? Yes. :confused:
 
Agreed, but not quite as stupid as Only Allowing One Bluetooth game controller to operate at one time.
 
Back
Top