Prevent installation of devices that match any of these device IDs
Empêcher l’installation de périphériques correspondant à l’un de ces ID de périphériques
Explanation
This policy setting allows you to specify a list of Plug and Play hardware IDs and compatible IDs for devices that Windows is prevented from installing. By default, this policy setting takes precedence over any other policy setting that allows Windows to install a device.
NOTE: To enable the "Allow installation of devices that match any of these device instance IDs" policy setting to supersede this policy setting for applicable devices, enable the "Apply layered order of evaluation for Allow and Prevent device installation policies across all device match criteria" policy setting.
If you enable this policy setting, Windows is prevented from installing a device whose hardware ID or compatible ID appears in the list you create. If you enable this policy setting on a remote desktop server, the policy setting affects redirection of the specified devices from a remote desktop client to the remote desktop server.
If you disable or do not configure this policy setting, devices can be installed and updated as allowed or prevented by other policy settings.
Ce paramètre de stratégie vous permet de spécifier une liste d’ID de matériel Plug-and-Play et d’ID compatibles pour les appareils que Windows ne peut pas installer. Par défaut, ce paramètre de stratégie prévaut sur tous les autres paramètres de stratégie qui permettent à Windows d’installer un périphérique.
REMARQUE : Pour activer le paramètre de stratégie « Autoriser l’installation de périphériques correspondant à l’un de ces ID de périphériques » afin de remplacer ce paramètre de stratégie pour les appareils applicables, activez le paramètre de stratégie « Appliquer un ordre d’évaluation par couches pour les stratégies Autoriser et Empêcher l’installation de périphériques sur tous les critères de correspondance des périphériques ».
Si vous activez ce paramètre de stratégie, Windows ne peut pas installer un périphérique dont l’ID matériel ou l’ID compatible apparaît dans la liste que vous avez créée. Si vous activez ce paramètre de stratégie sur un serveur Bureau à distance, celui-ci affecte la redirection des périphériques spécifiés d’un client Bureau à distance vers le serveur Bureau à distance.
Si vous désactivez ou ne configurez pas ce paramètre de stratégie, les périphériques peuvent être installés et mis à jour comme étant autorisés ou bloqués par d’autres paramètres de stratégie.
Use cases
Blocks specific devices by hardware ID, useful to forbid a given USB key model or a known adapter without touching others. Find IDs in Device Manager or with pnputil /enum-devices /ids.
This prevention overrides allow rules unless you enable the layered evaluation order.
Microsoft source: Manage device installation with Group Policy
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions- Value name
DenyDeviceIDs
| State | Value written |
|---|---|
| Enabled | REG_DWORD = 1 |
| Disabled | REG_DWORD = 0 |
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_IDs_Deny
$k = 'HKLM:\Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'DenyDeviceIDs' -Value 1 -Type DWord
# Also apply to matching devices that are already installed.
# unchecked: 0
Set-ItemProperty -Path $k -Name 'DenyDeviceIDsRetroactive' -Value 1 -Type DWord
$k = 'HKLM:\Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions\DenyDeviceIDs'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# Prevent installation of devices that match any of these Device IDs
# Non-additive list: existing values of the key are cleared first
if (Test-Path -Path $k) { (Get-Item -Path $k).Property | ForEach-Object { Remove-ItemProperty -Path $k -Name ([WildcardPattern]::Escape($_)) -ErrorAction SilentlyContinue } }
$values = @('<value1>', '<value2>') # Replace the values with your own
$i = 1
foreach ($v in $values) { Set-ItemProperty -Path $k -Name ('' + $i) -Value $v -Type String; $i++ }Disable
# Disable: DeviceInstallation/DeviceInstall_IDs_Deny
$k = 'HKLM:\Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'DenyDeviceIDs' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": DeviceInstallation/DeviceInstall_IDs_Deny
$k = 'HKLM:\Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions'
Remove-ItemProperty -Path $k -Name 'DenyDeviceIDs' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'DenyDeviceIDsRetroactive' -ErrorAction SilentlyContinue
$k = 'HKLM:\Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions\DenyDeviceIDs'
Remove-Item -Path $k -Recurse -Force -ErrorAction SilentlyContinueOptions (2)
| Label | Control | Registry value | REG type | Constraints / details |
|---|---|---|---|---|
| Prevent installation of devices that match any of these Device IDs:Empêcher l’installation de périphériques correspondant à l’un de ces ID de périphériques :DeviceInstall_IDs_Deny_List | List (table)list | Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions\DenyDeviceIDsValues named “” + number | REG_SZ (values under the key) | |
| Also apply to matching devices that are already installed.Appliquer également aux périphériques correspondants déjà installés.DeviceInstall_IDs_Deny_Retroactive | Check boxboolean | DenyDeviceIDsRetroactive | REG_DWORD | Checked: REG_DWORD = 1Unchecked: REG_DWORD = 0 |