Skriptausführung aktivieren: Registrierungswert EnableScripts und 1 weitereBenutzerHKCU\Software\Policies\Microsoft\Windows\PowerShell

Richtlinien-ID
EnableScripts
Bereich
Computerkonfiguration, Benutzerkonfiguration
Unterstützt unter
Mindestens Windows 7 oder Windows Server 2008
Quelle
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (Version 1.0)
Kategorie
Windows-Komponenten › Windows PowerShell

Registrierung

EnableScripts

REG_DWORDBenutzerComputer
…\Software\Policies\Microsoft\Windows\PowerShellHKCU\Software\Policies\Microsoft\Windows\PowerShell Aktueller Schlüssel
HKLM\Software\Policies\Microsoft\Windows\PowerShell
Wert bei Aktivierung
1
Wert bei Deaktivierung
0
Mit .reg · CMD · PowerShell anwenden
BenutzerEinstellung pro Konto
.reg
Windows Registry Editor Version 5.00

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

; Optionen (nur eine verwenden)
; Aktiviert
"EnableScripts"=dword:00000001
; Deaktiviert
"EnableScripts"=dword:00000000
CMD
:: Optionen (nur eine verwenden)

:: Aktiviert
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 1 /f
:: Deaktiviert
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 0 /f
PowerShell
# Gemeinsam: Schlüssel erstellen
New-Item -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null

# Optionen (nur eine verwenden)
# Aktiviert
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 1 -Force | Out-Null
# Deaktiviert
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 0 -Force | Out-Null
ComputerComputerweite Einstellung
.reg
Windows Registry Editor Version 5.00

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

; Optionen (nur eine verwenden)
; Aktiviert
"EnableScripts"=dword:00000001
; Deaktiviert
"EnableScripts"=dword:00000000
CMD
:: Optionen (nur eine verwenden)

:: Aktiviert
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 1 /f
:: Deaktiviert
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 0 /f
PowerShell
# Gemeinsam: Schlüssel erstellen
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null

# Optionen (nur eine verwenden)
# Aktiviert
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 1 -Force | Out-Null
# Deaktiviert
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 0 -Force | Out-Null

ExecutionPolicy

REG_SZBenutzerComputer
…\Software\Policies\Microsoft\Windows\PowerShellHKCU\Software\Policies\Microsoft\Windows\PowerShell Aktueller Schlüssel
HKLM\Software\Policies\Microsoft\Windows\PowerShell
Wert bei Aktivierung
Hängt vom Wert der Option ab
Element
Ausführungsrichtlinie
Optionen
EintragGespeicherter Wert
Nur signierte Skripts zulassenAllSigned
Lokale Skripts und remote signierte Skripts zulassenRemoteSigned
Alle Skripts zulassenUnrestricted
Mit .reg · CMD · PowerShell anwenden
BenutzerEinstellung pro Konto
.reg
Windows Registry Editor Version 5.00

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

; Optionen (nur eine verwenden)
; Nur signierte Skripts zulassen
"ExecutionPolicy"="AllSigned"
; Lokale Skripts und remote signierte Skripts zulassen
"ExecutionPolicy"="RemoteSigned"
; Alle Skripts zulassen
"ExecutionPolicy"="Unrestricted"
CMD
:: Optionen (nur eine verwenden)

:: Nur signierte Skripts zulassen
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "AllSigned" /f
:: Lokale Skripts und remote signierte Skripts zulassen
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "RemoteSigned" /f
:: Alle Skripts zulassen
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "Unrestricted" /f
PowerShell
# Gemeinsam: Schlüssel erstellen
New-Item -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null

# Optionen (nur eine verwenden)
# Nur signierte Skripts zulassen
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'AllSigned' -Force | Out-Null
# Lokale Skripts und remote signierte Skripts zulassen
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'RemoteSigned' -Force | Out-Null
# Alle Skripts zulassen
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'Unrestricted' -Force | Out-Null
ComputerComputerweite Einstellung
.reg
Windows Registry Editor Version 5.00

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

; Optionen (nur eine verwenden)
; Nur signierte Skripts zulassen
"ExecutionPolicy"="AllSigned"
; Lokale Skripts und remote signierte Skripts zulassen
"ExecutionPolicy"="RemoteSigned"
; Alle Skripts zulassen
"ExecutionPolicy"="Unrestricted"
CMD
:: Optionen (nur eine verwenden)

:: Nur signierte Skripts zulassen
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "AllSigned" /f
:: Lokale Skripts und remote signierte Skripts zulassen
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "RemoteSigned" /f
:: Alle Skripts zulassen
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "Unrestricted" /f
PowerShell
# Gemeinsam: Schlüssel erstellen
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null

# Optionen (nur eine verwenden)
# Nur signierte Skripts zulassen
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'AllSigned' -Force | Out-Null
# Lokale Skripts und remote signierte Skripts zulassen
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'RemoteSigned' -Force | Out-Null
# Alle Skripts zulassen
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'Unrestricted' -Force | Out-Null