Configura il comportamento del comando sudo: valore del Registro di sistema EnabledComputerHKLM\Software\Policies\Microsoft\Windows\Sudo

ID criterio
EnableSudo
Ambito
Configurazione computer
Supportato in
Almeno Windows 11
Origine
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (versione 1.0)
Categoria
Sistema

Registro

Enabled

REG_DWORDComputer
Valore abilitato
Dipende dal valore dell'opzione
Elemento
Modalità sudo massima consentita
Opzioni
VoceValore memorizzato
Disabilitato0
Forza nuova finestra1
Disabilita input2
Normale3
Applica con .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00

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

; Opzioni (usarne solo una)
; Disabilitato
"Enabled"=dword:00000000
; Forza nuova finestra
"Enabled"=dword:00000001
; Disabilita input
"Enabled"=dword:00000002
; Normale
"Enabled"=dword:00000003
CMD
:: Opzioni (usarne solo una)

:: Disabilitato
reg add "HKLM\Software\Policies\Microsoft\Windows\Sudo" /v "Enabled" /t REG_DWORD /d 0 /f
:: Forza nuova finestra
reg add "HKLM\Software\Policies\Microsoft\Windows\Sudo" /v "Enabled" /t REG_DWORD /d 1 /f
:: Disabilita input
reg add "HKLM\Software\Policies\Microsoft\Windows\Sudo" /v "Enabled" /t REG_DWORD /d 2 /f
:: Normale
reg add "HKLM\Software\Policies\Microsoft\Windows\Sudo" /v "Enabled" /t REG_DWORD /d 3 /f
PowerShell
# Comune: crea la chiave
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\Sudo' -Force | Out-Null

# Opzioni (usarne solo una)
# Disabilitato
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\Sudo' -Name 'Enabled' -PropertyType DWord -Value 0 -Force | Out-Null
# Forza nuova finestra
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\Sudo' -Name 'Enabled' -PropertyType DWord -Value 1 -Force | Out-Null
# Disabilita input
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\Sudo' -Name 'Enabled' -PropertyType DWord -Value 2 -Force | Out-Null
# Normale
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\Sudo' -Name 'Enabled' -PropertyType DWord -Value 3 -Force | Out-Null