PowerShell Execution Policy Registry Key Guide

PowerShell script execution on a Windows system is governed by the PowerShell Execution Policy, which determines whether scripts are allowed to run and under what conditions. These settings are stored directly in the Windows Registry across machine-wide, user-specific, and Group Policy-managed keys. Understanding these exact registry locations enables administrators to configure, audit, or troubleshoot PowerShell script permissions without launching a PowerShell console.

Primary Registry Key Locations

The core registry keys that store the PowerShell execution policy for standard configurations are:

Within these keys, the string value (REG_SZ) named ExecutionPolicy defines the active policy.

Group Policy Registry Keys

When execution policies are managed via Group Policy, they take precedence over the primary keys and are located in the Policies hive:

In the Group Policy registry keys, two values control script execution: * EnableScripts (REG_DWORD): Set to 1 to enable script execution or 0 to disable it. * ExecutionPolicy (REG_SZ): Defines the specific policy string.

Supported Execution Policy Values

The ExecutionPolicy registry string value accepts the following configurations:

Precedence Order

When determining the effective policy, Windows evaluates registry settings in the following order (highest precedence to lowest):

  1. Group Policy Machine (HKLM\SOFTWARE\Policies\...)
  2. Group Policy User (HKCU\SOFTWARE\Policies\...)
  3. Current User (HKCU\Software\...)
  4. Local Machine (HKLM\SOFTWARE\...)