memstechtips / UnattendedWinstall

Personalized Unattended Answer Files that helps automatically debloat and customize Windows 10 & 11 during the installation process.
MIT License
3.59k stars 399 forks source link

Nightlight does not work with Windows 11 Pro when using IoT-LTSC-Like.” #145

Closed toanhd closed 2 weeks ago

toanhd commented 1 month ago

I installed Windows 11 Pro using IoT-LTSC-Like. After installation, the night light feature isn't working, and I can't adjust the screen's warm level.

Which part of the script should I modify to fix this issue? Please advise

geot0 commented 1 month ago

From: https://answers.microsoft.com/en-us/windows/forum/all/how-do-i-fix-the-night-light-setting-in-windows-11/81c8c3da-ced2-4b84-8472-f41076a235e7

There are 3 Windows services necessary for night lighting to work properly:

If the "Connected Devices Platform Service" and "Network Connection Broker" services have the "disabled" start type, the "night lighting" functionality in the "Settings" application does not work, if we click on the button for the activate, nothing happens. For the night lighting setting to work, these services can be configured with the "manual" or "automatic" start type with the service management console (services.msc).

The "Connected Devices Platform User Service" service must be configured with the "automatic" start type for night lighting to work. This service (called "template service") create a secondary service (called "Per-user service") with the same name followed by a random hexadecimal number (e.g.: Connected Devices Platform User Service_253cb) when a user log in (source: https://docs.microsoft.com/en-us/windows/application-management/per-user-services-in-windows).

This service cannot be configured with services.msc, so you must modify its configuration with the Windows registry by executing these commands in Administrator:

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CDPUserSvc" /v Start /t REG_DWORD /d 2 /f

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CDPUserSvc" /v UserServiceFlags /t REG_DWORD /d 3 /f

Setting the value "Start" to 2 configures the type of start to "Automatic".

Setting the value "UserServiceFlags" to 3 allows the creation of the service per user.

When a user log in, the created per-user service inherits the configuration parameters from the service template. So, if the value "Start" of the template service is 2, the service per user created will have the same value "Start" to 2.

After applying these settings, restart the computer and test the night lighting again.

memstechtips commented 2 weeks ago

Closing this assuming the reply from @geot0 fixes the issue.