We recently installed a new Windows 2022 Server and joined it to a Domain. After adding it to the Domain, everything look good and the network was identified as Domain as it should. Upon reboot, it was no longer identified as being on a Domain network and fell back to Unidentified or Public Network.
We’ve seen this behavior before with other editions of Windows. Changing the Network Location Awareness (NLA) Service to “Automatic (Delayed Start)” and restarting the service would resolve the issue. The Domain network is identified properly on subsequent reboots. Not the case with Windows 2022 Server. Changing the NLA Service to Automatic Delayed Start does not fix the problem.
With 2022 Server, you can’t restart the NLA service because the Network List Service depends on it. For whatever reason, it can’t be stopped. If you find the PID and kill it, it restarts itself and then the network is identified properly as Domain. Doing this after every reboot is not an option.
In the course of troubleshooting this issue, we found two other ways to convince the machine that it was on a Domain network.
- Disabling IPv6 on the network adapter.
- Disabling the WAN (IP) and (IPv6) Miniport Network adapters in Device Manager.
Both of these methods are not viable solutions either.
The solution was to create a batch script to find the PID of the NLA Service and kill it. This batch script runs once as a Scheduled Task on System Startup. It needs to wait about 30 seconds after Startup before executing.
timeout /T 30
for /F "tokens=1,2,3,4,5" %%A in ('"sc queryex nlasvc |find "PID""') DO (
taskkill /f /pid %%C
)