Prevent Internet Explorer security prompt for Windows Installer scripts
Désactiver la confirmation de sécurité Internet Explorer pour les scripts de Windows Installer
Explanation
This policy setting allows Web-based programs to install software on the computer without notifying the user.
If you disable or do not configure this policy setting, by default, when a script hosted by an Internet browser tries to install a program on the system, the system warns users and allows them to select or refuse the installation.
If you enable this policy setting, the warning is suppressed and allows the installation to proceed.
This policy setting is designed for enterprises that use Web-based tools to distribute programs to their employees. However, because this policy setting can pose a security risk, it should be applied cautiously.
Ce paramètre de stratégie permet aux programmes Web d’installer des logiciels sur l’ordinateur sans en informer l’utilisateur.
Si vous désactivez ce paramètre de stratégie ou si vous ne le configurez pas, par défaut, lorsqu’un script hébergé par un navigateur Internet tente d’installer un programme sur le système, le système avertit les utilisateurs afin qu’ils puissent sélectionner ou refuser l’installation.
Si vous activez ce paramètre de stratégie, l’avertissement est supprimé et l’installation est autorisée à se poursuivre.
Ce paramètre de stratégie est destiné aux entreprises qui utilisent des outils Web pour distribuer des programmes à leurs employés. En raison des éventuels risques de sécurité que peut poser ce paramètre de stratégie, celui-ci doit être appliqué avec précautions.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer- Value name
SafeForScripting
| 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/SafeForScripting
$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 'SafeForScripting' -Value 1 -Type DWordDisable
# Disable: MSI/SafeForScripting
$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 'SafeForScripting' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": MSI/SafeForScripting
$k = 'HKLM:\Software\Policies\Microsoft\Windows\Installer'
Remove-ItemProperty -Path $k -Name 'SafeForScripting' -ErrorAction SilentlyContinue