Prohibit removal of updates
Empêcher la suppression des mises à jour
Explanation
This policy setting controls the ability for users or administrators to remove Windows Installer based updates.
This policy setting should be used if you need to maintain a tight control over updates. One example is a lockdown environment where you want to ensure that updates once installed cannot be removed by users or administrators.
If you enable this policy setting, updates cannot be removed from the computer by a user or an administrator. The Windows Installer can still remove an update that is no longer applicable to the product.
If you disable or do not configure this policy setting, a user can remove an update from the computer only if the user has been granted privileges to remove the update. This can depend on whether the user is an administrator, whether "Disable Windows Installer" and "Always install with elevated privileges" policy settings are set, and whether the update was installed in a per-user managed, per-user unmanaged, or per-machine context."
Ce paramètre de stratégie contrôle la capacité des utilisateurs ou des administrateurs à désinstaller les mises à jour d’applications compatibles Windows Installer.
Ce paramètre de stratégie doit être utilisé si vous voulez maintenir un contrôle strict sur les mises à jour. Par exemple, dans un environnement verrouillé pour lequel vous voulez vous assurer que les mises à jour installées ne peuvent pas être désinstallées par les utilisateurs ou par les administrateurs.
Si vous activez ce paramètre de stratégie, les mises à jour ne peuvent pas être supprimées de l’ordinateur par un utilisateur ou par un administrateur. Windows Installer peut toujours supprimer une mise à jour qui ne s’applique plus au produit.
Si vous désactivez ce paramètre de stratégie ou si vous ne le configurez pas, un utilisateur peut supprimer une mise à jour de l’ordinateur uniquement s’il dispose de droits pour la supprimer. Cela dépend de plusieurs paramètres, par exemple si l’utilisateur est un administrateur, si les paramètres de stratégie « Désactiver Windows Installer » et « Toujours installer avec des droits élevés » sont définis, et si la mise à jour a été installée dans un contexte géré par l’utilisateur, non géré par l’utilisateur ou par ordinateur.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer- Value name
DisablePatchUninstall
| 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: MSI/MSI_DisablePatchUninstall
$k = 'HKLM:\Software\Policies\Microsoft\Windows\Installer'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'DisablePatchUninstall' -Value 1 -Type DWordDisable
# Disable: MSI/MSI_DisablePatchUninstall
$k = 'HKLM:\Software\Policies\Microsoft\Windows\Installer'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'DisablePatchUninstall' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": MSI/MSI_DisablePatchUninstall
$k = 'HKLM:\Software\Policies\Microsoft\Windows\Installer'
Remove-ItemProperty -Path $k -Name 'DisablePatchUninstall' -ErrorAction SilentlyContinue