Display a custom message when installation is prevented by a policy setting
Afficher un message personnalisé lorsque l’installation est empêchée par un paramètre de stratégie
Explanation
This policy setting allows you to display a custom message to users in a notification when a device installation is attempted and a policy setting prevents the installation.
If you enable this policy setting, Windows displays the text you type in the Detail Text box when a policy setting prevents device installation.
If you disable or do not configure this policy setting, Windows displays a default message when a policy setting prevents device installation.
Ce paramètre de stratégie vous permet d’afficher un message personnalisé aux utilisateurs dans une notification lorsqu’un paramètre de stratégie empêche l’installation d’un périphérique.
Si vous activez ce paramètre de stratégie, Windows affiche le texte que vous avez tapé dans la zone Détails lorsqu’un paramètre de stratégie empêche l’installation d’un périphérique.
Si vous désactivez ce paramètre de stratégie ou ne le configurez pas, Windows affiche un message par défaut lorsqu’un paramètre de stratégie empêche l’installation d’un périphérique.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions\DeniedPolicy- 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: DeviceInstallation/DeviceInstall_DeniedPolicy_DetailText
$k = 'HKLM:\Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions\DeniedPolicy'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# Detail Text
Set-ItemProperty -Path $k -Name 'DetailText' -Value '<value>' -Type StringDisable
# Disable: DeviceInstallation/DeviceInstall_DeniedPolicy_DetailText
# No value is written in the "Disabled" state (nothing defined in the ADMX)Revert to "Not configured"
# Revert to "Not configured": DeviceInstallation/DeviceInstall_DeniedPolicy_DetailText
$k = 'HKLM:\Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions\DeniedPolicy'
Remove-ItemProperty -Path $k -Name 'DetailText' -ErrorAction SilentlyContinueOptions (1)
| Label | Control | Registry value | REG type | Constraints / details |
|---|---|---|---|---|
| Detail TextDétailsDeviceInstall_DeniedPolicy_DetailText_Text | Text boxtext | DetailText | REG_SZ | Required · Max length: 128 |