Open in the explorer

Prevent IIS installation

Empêcher l'installation d'IIS

Type
Computer
GPO path
Computer Configuration › Policies › Administrative Templates › Windows Components › Internet Information Services FR: Configuration ordinateur › Stratégies › Modèles d'administration › Composants Windows › Internet Information Services
Supported on
Windows Server 2003 only FR: Windows Server 2003 uniquement
ADMX file
IIS.admx
Internal name
IIS/PreventIISInstall

Explanation

"This policy setting prevents installation of Internet Information Services (IIS) on this computer. If you enable this policy setting, Internet Information Services (IIS) cannot be installed, and you will not be able to install Windows components or applications that require IIS. Users installing Windows components or applications that require IIS might not receive a warning that IIS cannot be installed because of this Group Policy setting. Enabling this setting will not have any effect on IIS if IIS is already installed on the computer. If you disable or do not configure this policy setting, IIS can be installed, as well as all the programs and applications that require IIS to run."

French text from Windows 11 26H2

« Le paramètre de cette stratégie empêche l'installation des Internet Information Services (IIS) sur cet ordinateur. Si vous activez le paramètre de cette stratégie, les Internet Information Services (IIS) ne peuvent être installés et vous ne pourrez installer de composants ou d'applications Windows nécessitant IIS. Les utilisateurs qui installent des composants ou des applications Windows nécessitant IIS peuvent ne pas recevoir d'avertissement indiquant qu'IIS ne peut pas être installé en raison du paramètre de cette stratégie de groupe. L'activation de ce paramètre n'aura aucun effet sur IIS si IIS est déjà installé sur l'ordinateur. Si vous désactivez ou ne configurez pas ce paramètre de stratégie, IIS ainsi que tous les programmes et applications nécessitant l'exécution d'IIS peuvent être installés. »

Registry

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\IIS
Value name
PreventIISInstall
StateValue written
EnabledREG_DWORD = 1
DisabledREG_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: IIS/PreventIISInstall
$k = 'HKLM:\Software\Policies\Microsoft\Windows NT\IIS'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'PreventIISInstall' -Value 1 -Type DWord

Disable

# Disable: IIS/PreventIISInstall
$k = 'HKLM:\Software\Policies\Microsoft\Windows NT\IIS'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'PreventIISInstall' -Value 0 -Type DWord

Revert to "Not configured"

# Revert to "Not configured": IIS/PreventIISInstall
$k = 'HKLM:\Software\Policies\Microsoft\Windows NT\IIS'
Remove-ItemProperty -Path $k -Name 'PreventIISInstall' -ErrorAction SilentlyContinue

Availability