スクリプトの実行を有効にする のレジストリ値 EnableScripts ほか 1 件コンピューターHKLM\Software\Policies\Microsoft\Windows\PowerShell

ポリシー ID
EnableScripts
適用対象
コンピューターの構成、ユーザーの構成
サポートされるバージョン
Windows 7 以降および Microsoft Windows Server 2008 ファミリ以降
出典
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (バージョン 1.0)
カテゴリ
Windows コンポーネント › Windows PowerShell

レジストリ

EnableScripts

REG_DWORDコンピューターユーザー
有効時の値
1
無効時の値
0
.reg · CMD · PowerShell で適用する
コンピューターコンピューター全体の設定
.reg
Windows Registry Editor Version 5.00

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

; 選択項目 (1 つだけ使用)
; 有効
"EnableScripts"=dword:00000001
; 無効
"EnableScripts"=dword:00000000
CMD
:: 選択項目 (1 つだけ使用)

:: 有効
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 1 /f
:: 無効
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 0 /f
PowerShell
# 共通: キーを作成
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null

# 選択項目 (1 つだけ使用)
# 有効
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 1 -Force | Out-Null
# 無効
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 0 -Force | Out-Null
ユーザーアカウントごとの設定
.reg
Windows Registry Editor Version 5.00

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

; 選択項目 (1 つだけ使用)
; 有効
"EnableScripts"=dword:00000001
; 無効
"EnableScripts"=dword:00000000
CMD
:: 選択項目 (1 つだけ使用)

:: 有効
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 1 /f
:: 無効
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 0 /f
PowerShell
# 共通: キーを作成
New-Item -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null

# 選択項目 (1 つだけ使用)
# 有効
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 1 -Force | Out-Null
# 無効
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 0 -Force | Out-Null

ExecutionPolicy

REG_SZコンピューターユーザー
有効時の値
オプションの値に依存
要素
実行ポリシー
オプション
項目保存される値
署名済みスクリプトのみ許可するAllSigned
ローカル スクリプトおよびリモートの署名済みスクリプトを許可するRemoteSigned
すべてのスクリプトを許可するUnrestricted
.reg · CMD · PowerShell で適用する
コンピューターコンピューター全体の設定
.reg
Windows Registry Editor Version 5.00

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

; 選択項目 (1 つだけ使用)
; 署名済みスクリプトのみ許可する
"ExecutionPolicy"="AllSigned"
; ローカル スクリプトおよびリモートの署名済みスクリプトを許可する
"ExecutionPolicy"="RemoteSigned"
; すべてのスクリプトを許可する
"ExecutionPolicy"="Unrestricted"
CMD
:: 選択項目 (1 つだけ使用)

:: 署名済みスクリプトのみ許可する
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "AllSigned" /f
:: ローカル スクリプトおよびリモートの署名済みスクリプトを許可する
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "RemoteSigned" /f
:: すべてのスクリプトを許可する
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "Unrestricted" /f
PowerShell
# 共通: キーを作成
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null

# 選択項目 (1 つだけ使用)
# 署名済みスクリプトのみ許可する
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'AllSigned' -Force | Out-Null
# ローカル スクリプトおよびリモートの署名済みスクリプトを許可する
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'RemoteSigned' -Force | Out-Null
# すべてのスクリプトを許可する
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'Unrestricted' -Force | Out-Null
ユーザーアカウントごとの設定
.reg
Windows Registry Editor Version 5.00

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

; 選択項目 (1 つだけ使用)
; 署名済みスクリプトのみ許可する
"ExecutionPolicy"="AllSigned"
; ローカル スクリプトおよびリモートの署名済みスクリプトを許可する
"ExecutionPolicy"="RemoteSigned"
; すべてのスクリプトを許可する
"ExecutionPolicy"="Unrestricted"
CMD
:: 選択項目 (1 つだけ使用)

:: 署名済みスクリプトのみ許可する
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "AllSigned" /f
:: ローカル スクリプトおよびリモートの署名済みスクリプトを許可する
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "RemoteSigned" /f
:: すべてのスクリプトを許可する
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "Unrestricted" /f
PowerShell
# 共通: キーを作成
New-Item -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null

# 選択項目 (1 つだけ使用)
# 署名済みスクリプトのみ許可する
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'AllSigned' -Force | Out-Null
# ローカル スクリプトおよびリモートの署名済みスクリプトを許可する
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'RemoteSigned' -Force | Out-Null
# すべてのスクリプトを許可する
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'Unrestricted' -Force | Out-Null