Force a specific background and accent color
Forcer l’utilisation d’un couleur d’accentuation et d’arrière-plan spécifique
Explanation
Forces Windows to use the specified colors for the background and accent. The color values are specified in hex as #RGB.
By default, users can change the background and accent colors.
If this setting is enabled, the background and accent colors of Windows will be set to the specified colors and users cannot change those colors. This setting will not be applied if the specified colors do not meet a contrast ratio of 2:1 with white text.
Force Windows à utiliser les couleurs spécifiées pour l’arrière-plan et l’accentuation. Les valeurs des couleurs sont spécifiées au format hexadécimal sous la forme #RVB.
Par défaut, les utilisateurs peuvent modifier les couleurs d’arrière-plan et d’accentuation.
Si ce paramètre est activé, les couleurs d’arrière-plan et d’accentuation de Windows correspondent aux couleurs spécifiées et les utilisateurs ne peuvent pas modifier ces couleurs. Ce paramètre n’est pas appliqué si les couleurs spécifiées ne respectent pas un taux de contraste de 2:1 avec le texte blanc.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Personalization- Value name
- not defined in the ADMX
Enable / disable values: not defined in the ADMX (see the options below).
PowerShell
PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.
Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.
Enable
# Enable: ControlPanelDisplay/CPL_Personalization_PersonalColors
$k = 'HKLM:\Software\Policies\Microsoft\Windows\Personalization'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# Start background color
Set-ItemProperty -Path $k -Name 'PersonalColors_Background' -Value '<value>' -Type String
# Accent color
Set-ItemProperty -Path $k -Name 'PersonalColors_Accent' -Value '<value>' -Type StringDisable
# Disable: ControlPanelDisplay/CPL_Personalization_PersonalColors
# No value is written in the "Disabled" state (nothing defined in the ADMX)Revert to "Not configured"
# Revert to "Not configured": ControlPanelDisplay/CPL_Personalization_PersonalColors
$k = 'HKLM:\Software\Policies\Microsoft\Windows\Personalization'
Remove-ItemProperty -Path $k -Name 'PersonalColors_Background' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'PersonalColors_Accent' -ErrorAction SilentlyContinueOptions (2)
| Label | Control | Registry value | REG type | Constraints / details |
|---|---|---|---|---|
| Start background color:Couleur d’arrière-plan du menu Démarrer :PersonalColors_Background | Text boxtext | PersonalColors_Background | REG_SZ | Required |
| Accent color:Couleur d’accentuation :PersonalColors_Accent | Text boxtext | PersonalColors_Accent | REG_SZ | Required |