Prevent installation of devices that match any of these device instance IDs
Empêcher l’installation de périphériques correspondant à l’un de ces ID d’instance de périphérique
Explanation
This policy setting allows you to specify a list of Plug and Play device instance IDs for devices that Windows is prevented from installing. This policy setting takes precedence over any other policy setting that allows Windows to install a device.
If you enable this policy setting, Windows is prevented from installing a device whose device instance 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 d’instances de périphérique Plug-and-Play pour les périphériques que Windows ne peut pas installer. Ce paramètre de stratégie prévaut sur tout autre paramètre de stratégie autorisant l’installation d’un périphérique par Windows.
Si vous activez ce paramètre de stratégie, Windows ne peut pas installer un périphérique dont l’ID d’instance de périphérique apparaît dans la liste que vous créez. Si vous activez ce paramètre de stratégie sur un serveur Bureau à distance, ce paramètre de stratégie a une incidence sur la redirection des périphériques spécifiés depuis un client Bureau à distance vers le serveur Bureau à distance.
Si vous désactivez ce paramètre de stratégie ou si vous ne le configurez pas, les périphériques peuvent être installés et mis à jour conformément aux autorisations ou interdictions prévues par d’autres paramètres de stratégie.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions- Value name
DenyInstanceIDs
| 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_Instance_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 'DenyInstanceIDs' -Value 1 -Type DWord
# Also apply to matching devices that are already installed.
# unchecked: 0
Set-ItemProperty -Path $k -Name 'DenyInstanceIDsRetroactive' -Value 1 -Type DWord
$k = 'HKLM:\Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions\DenyInstanceIDs'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# Prevent installation of devices that match any of these device instance 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_Instance_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 'DenyInstanceIDs' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": DeviceInstallation/DeviceInstall_Instance_IDs_Deny
$k = 'HKLM:\Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions'
Remove-ItemProperty -Path $k -Name 'DenyInstanceIDs' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'DenyInstanceIDsRetroactive' -ErrorAction SilentlyContinue
$k = 'HKLM:\Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions\DenyInstanceIDs'
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 instance IDs:Empêcher l’installation de périphériques correspondant à l’un de ces ID d’instance de périphérique :DeviceInstall_Instance_IDs_Deny_List | List (table)list | Software\Policies\Microsoft\Windows\DeviceInstall\Restrictions\DenyInstanceIDsValues 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_Instance_IDs_Deny_Retroactive | Check boxboolean | DenyInstanceIDsRetroactive | REG_DWORD | Checked: REG_DWORD = 1Unchecked: REG_DWORD = 0 |