Prevent deletion of printers
Interdire la suppression des imprimantes
Explanation
If this policy setting is enabled, it prevents users from deleting local and network printers.
If a user tries to delete a printer, such as by using the Delete option in Printers in Control Panel, a message appears explaining that a setting prevents the action.
This setting does not prevent users from running other programs to delete a printer.
If this policy is disabled, or not configured, users can delete printers using the methods described above.
Lorsque ce paramètre de stratégie est activé, il empêche les utilisateurs de supprimer des imprimantes locales et réseau.
Si un utilisateur tente de supprimer une imprimante, par exemple en utilisant l’option Supprimer de l’application Imprimantes dans le Panneau de configuration, un message s’affiche pour expliquer que cette action est interdite par un paramètre.
Ce paramètre n’empêche pas les utilisateurs d’exécuter d’autres programmes de suppression d’une imprimante.
Si cette stratégie est désactivée ou si elle n’est pas configurée, les utilisateurs peuvent supprimer des imprimantes en faisant appel aux méthodes décrites ci-dessus.
Registry
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer- Value name
NoDeletePrinter
| 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: Printing/NoDeletePrinter
$k = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'NoDeletePrinter' -Value 1 -Type DWordDisable
# Disable: Printing/NoDeletePrinter
$k = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'NoDeletePrinter' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": Printing/NoDeletePrinter
$k = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
Remove-ItemProperty -Path $k -Name 'NoDeletePrinter' -ErrorAction SilentlyContinue