Open in the explorer

View menu: Disable Source menu option

Menu Affichage : désactiver la commande Source

Type
User
GPO path
User Configuration › Policies › Administrative Templates › Windows Components › Internet Explorer › Browser menus FR: Configuration utilisateur › Stratégies › Modèles d'administration › Composants Windows › Internet Explorer › Menus du navigateur
Supported on
At least Internet Explorer 5.0 FR: Au moins Internet Explorer 5.0
ADMX file
inetres.admx
Internal name
inetres/View_NoViewSource

Explanation

Prevents users from viewing the HTML source of Web pages by clicking the Source command on the View menu.

If you enable this policy, the Source command on the View menu will appear dimmed.

If you disable this policy or do not configure it, then users can view the HTML source of Web pages from the browser View menu.

Caution: This policy does not prevent users from viewing the HTML source of a Web page by right-clicking a Web page to open the shortcut menu, and then clicking View Source. To prevent users from viewing the HTML source of a Web page from the shortcut menu, set the "Turn off Shortcut Menu" policy, which disables the entire shortcut menu.

French text from Windows 11 26H2

Empêche les utilisateurs de visualiser la source HTML des pages Web en cliquant sur la commande Source dans le menu Affichage.

Si vous activez ce paramètre de stratégie, la commande Source du menu Affichage est estompée.

Si vous désactivez ce paramètre de stratégie ou si vous ne le configurez pas, les utilisateurs peuvent visualiser la source HTML des pages Web à partir du menu Affichage du navigateur.

Attention : ce paramètre de stratégie n’empêche pas les utilisateurs de visualiser la source HTML d’une page Web en cliquant avec le bouton droit de la souris pour ouvrir le menu contextuel, puis en cliquant sur Afficher la source. Pour empêcher les utilisateurs d’afficher la source HTML d’une page web depuis le menu contextuel, définissez le paramètre de stratégie « Désactiver le menu contextuel », qui désactive le menu contextuel entier.

Registry

HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Restrictions
Value name
NoViewSource
StateValue written
Enablednot defined in the ADMX
Disablednot defined in the ADMX

PowerShell

PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.

The ADMX does not specify the value written when enabled; the GPO editor usually writes REG_DWORD 1 (enabled) / 0 (disabled). The commands below use 1/0 as an assumption.

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: inetres/View_NoViewSource
$k = 'HKCU:\Software\Policies\Microsoft\Internet Explorer\Restrictions'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# The ADMX does not specify the value written; the GPO editor usually writes REG_DWORD 1 (enabled) / 0 (disabled)
Set-ItemProperty -Path $k -Name 'NoViewSource' -Value 1 -Type DWord  # assumed value (not defined in the ADMX)

Disable

# Disable: inetres/View_NoViewSource
$k = 'HKCU:\Software\Policies\Microsoft\Internet Explorer\Restrictions'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# The ADMX does not specify the value written; the GPO editor usually writes REG_DWORD 1 (enabled) / 0 (disabled)
Set-ItemProperty -Path $k -Name 'NoViewSource' -Value 0 -Type DWord  # assumed value (not defined in the ADMX)

Revert to "Not configured"

# Revert to "Not configured": inetres/View_NoViewSource
$k = 'HKCU:\Software\Policies\Microsoft\Internet Explorer\Restrictions'
Remove-ItemProperty -Path $k -Name 'NoViewSource' -ErrorAction SilentlyContinue

Availability