Configurer le comportement de la commande sudo : valeur de Registre EnabledOrdinateurHKLM\Software\Policies\Microsoft\Windows\Sudo

ID de stratégie
EnableSudo
Étendue
Configuration ordinateur
Pris en charge sur
Au minimum Windows 11
Source
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (version 1.0)
Catégorie
Système

Registre

Enabled

REG_DWORDOrdinateur
Valeur si activée
Dépend de la valeur de l'option
Élément
Mode sudo maximum autorisé
Options
EntréeValeur stockée
Désactivé0
Forcer une nouvelle fenêtre1
Désactiver l’entrée2
Normal3
Appliquer avec .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Sudo]

; Options (en utiliser une seule)
; Désactivé
"Enabled"=dword:00000000
; Forcer une nouvelle fenêtre
"Enabled"=dword:00000001
; Désactiver l’entrée
"Enabled"=dword:00000002
; Normal
"Enabled"=dword:00000003
CMD
:: Options (en utiliser une seule)

:: Désactivé
reg add "HKLM\Software\Policies\Microsoft\Windows\Sudo" /v "Enabled" /t REG_DWORD /d 0 /f
:: Forcer une nouvelle fenêtre
reg add "HKLM\Software\Policies\Microsoft\Windows\Sudo" /v "Enabled" /t REG_DWORD /d 1 /f
:: Désactiver l’entrée
reg add "HKLM\Software\Policies\Microsoft\Windows\Sudo" /v "Enabled" /t REG_DWORD /d 2 /f
:: Normal
reg add "HKLM\Software\Policies\Microsoft\Windows\Sudo" /v "Enabled" /t REG_DWORD /d 3 /f
PowerShell
# Commun : créer la clé
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\Sudo' -Force | Out-Null

# Options (en utiliser une seule)
# Désactivé
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\Sudo' -Name 'Enabled' -PropertyType DWord -Value 0 -Force | Out-Null
# Forcer une nouvelle fenêtre
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\Sudo' -Name 'Enabled' -PropertyType DWord -Value 1 -Force | Out-Null
# Désactiver l’entrée
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\Sudo' -Name 'Enabled' -PropertyType DWord -Value 2 -Force | Out-Null
# Normal
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\Sudo' -Name 'Enabled' -PropertyType DWord -Value 3 -Force | Out-Null