Attiva l'esecuzione di script: valore del Registro di sistema EnableScripts e altri 1UtenteHKCU\Software\Policies\Microsoft\Windows\PowerShell

ID criterio
EnableScripts
Ambito
Configurazione computer, Configurazione utente
Supportato in
Almeno Windows 7 o famiglia Windows Server 2008
Origine
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (versione 1.0)
Categoria
Componenti di Windows › Windows PowerShell

Registro

EnableScripts

REG_DWORDUtenteComputer
Valore abilitato
1
Valore disabilitato
0
Applica con .reg · CMD · PowerShell
UtenteImpostazione per account
.reg
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\PowerShell]

; Opzioni (usarne solo una)
; Abilitato
"EnableScripts"=dword:00000001
; Disabilitato
"EnableScripts"=dword:00000000
CMD
:: Opzioni (usarne solo una)

:: Abilitato
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 1 /f
:: Disabilitato
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 0 /f
PowerShell
# Comune: crea la chiave
New-Item -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null

# Opzioni (usarne solo una)
# Abilitato
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 1 -Force | Out-Null
# Disabilitato
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 0 -Force | Out-Null
ComputerImpostazione globale del computer
.reg
Windows Registry Editor Version 5.00

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

; Opzioni (usarne solo una)
; Abilitato
"EnableScripts"=dword:00000001
; Disabilitato
"EnableScripts"=dword:00000000
CMD
:: Opzioni (usarne solo una)

:: Abilitato
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 1 /f
:: Disabilitato
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 0 /f
PowerShell
# Comune: crea la chiave
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null

# Opzioni (usarne solo una)
# Abilitato
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 1 -Force | Out-Null
# Disabilitato
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 0 -Force | Out-Null

ExecutionPolicy

REG_SZUtenteComputer
Valore abilitato
Dipende dal valore dell'opzione
Elemento
Criteri di esecuzione
Opzioni
VoceValore memorizzato
Consenti solo script firmatiAllSigned
Consenti script locali e script remoti firmatiRemoteSigned
Consenti tutti gli scriptUnrestricted
Applica con .reg · CMD · PowerShell
UtenteImpostazione per account
.reg
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\PowerShell]

; Opzioni (usarne solo una)
; Consenti solo script firmati
"ExecutionPolicy"="AllSigned"
; Consenti script locali e script remoti firmati
"ExecutionPolicy"="RemoteSigned"
; Consenti tutti gli script
"ExecutionPolicy"="Unrestricted"
CMD
:: Opzioni (usarne solo una)

:: Consenti solo script firmati
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "AllSigned" /f
:: Consenti script locali e script remoti firmati
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "RemoteSigned" /f
:: Consenti tutti gli script
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "Unrestricted" /f
PowerShell
# Comune: crea la chiave
New-Item -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null

# Opzioni (usarne solo una)
# Consenti solo script firmati
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'AllSigned' -Force | Out-Null
# Consenti script locali e script remoti firmati
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'RemoteSigned' -Force | Out-Null
# Consenti tutti gli script
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'Unrestricted' -Force | Out-Null
ComputerImpostazione globale del computer
.reg
Windows Registry Editor Version 5.00

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

; Opzioni (usarne solo una)
; Consenti solo script firmati
"ExecutionPolicy"="AllSigned"
; Consenti script locali e script remoti firmati
"ExecutionPolicy"="RemoteSigned"
; Consenti tutti gli script
"ExecutionPolicy"="Unrestricted"
CMD
:: Opzioni (usarne solo una)

:: Consenti solo script firmati
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "AllSigned" /f
:: Consenti script locali e script remoti firmati
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "RemoteSigned" /f
:: Consenti tutti gli script
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "Unrestricted" /f
PowerShell
# Comune: crea la chiave
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null

# Opzioni (usarne solo una)
# Consenti solo script firmati
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'AllSigned' -Force | Out-Null
# Consenti script locali e script remoti firmati
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'RemoteSigned' -Force | Out-Null
# Consenti tutti gli script
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'Unrestricted' -Force | Out-Null