PowerShell execution policy: Set-ExecutionPolicy

PowerShell execution policy : Set-ExecutionPolicy explained

Security

IT Operations

Troubleshooting

APPLICATION CONTROL

AUTOMATION

BEST PRACTICES

+9

Aliaska Varieva

September 30, 2026

794 views

Share

What the PowerShell execution policy does, the seven values and five scopes, how to set it for one user or a fleet, how to fix "running scripts is disabled on this system", and why Microsoft says it is not a security boundary.

Updated: October 2026

A script you wrote yesterday refuses to run on a new laptop, and the error points at something called an execution policy. The quick fix people paste online is one line, and it quietly changes how every script on that machine behaves. Here's what the execution policy in PowerShell does, how its scopes stack, how to fix the "running scripts is disabled" error without opening the whole fleet, and what to use when you need real control over scripts.

What the execution policy does

The execution policy decides whether PowerShell will load configuration files and run scripts, and whether those scripts need a digital signature. It only applies on Windows. On Linux and macOS it's fixed at Unrestricted and can't be changed.

Microsoft is blunt about its limits. The execution policy "isn't a security boundary, it's defense in depth," says the current about_Execution_Policies page on Microsoft Learn (updated August 2026). Its own example: a user who can't run a script can type the script's contents at the prompt instead. The policy exists to stop people running scripts by accident, not to stop someone who wants to.

That framing matters for everything below. Treat the execution policy as a seatbelt for your technicians, not a lock against attackers.

The seven PowerShell execution policy values from Restricted to Bypass, showing what happens to a local script and to a downloaded unsigned script under each one, with RemoteSigned marked as the sane default

The seven policy values

Policy Local script Downloaded, unsigned script Where you meet it
Restricted Blocked Blocked Windows client default in Windows PowerShell 5.1
AllSigned Needs a trusted signature Blocked Fleets that sign everything
RemoteSigned Runs Blocked until signed or unblocked Windows Server default
Unrestricted Runs Runs after a warning Linux and macOS, always
Bypass Runs Runs, no prompt Apps that embed PowerShell, one-off runs
Default Resets to the platform default Undoing a change
Undefined Clears one scope Removing a setting

Restricted still lets you run single commands. It blocks .ps1 files, module script files and PowerShell profiles. If every scope is Undefined, a Windows client falls back to Restricted and a Windows Server falls back to RemoteSigned.

Windows PowerShell 5.1, the one built into Windows, and PowerShell 7 keep separate settings. Changing one doesn't touch the other. PowerShell 7 stores its policy in powershell.config.json, while 5.1 uses the registry.

Scopes and precedence

You can set a policy at five scopes, and PowerShell uses the highest one that isn't Undefined:

MachinePolicy - set by Group Policy for the computer. Set-ExecutionPolicy can't change it.

UserPolicy - set by Group Policy for the user.

Process - the current session only, held in $Env:PSExecutionPolicyPreference and gone when the window closes.

CurrentUser - the signed-in user, stored under HKCU in 5.1. No admin rights needed.

LocalMachine - everyone on the computer, stored under HKLM in 5.1. This is the default scope, and it needs an elevated prompt.

Get-ExecutionPolicy -List shows all five at once. Read it top down. If CurrentUser says RemoteSigned and LocalMachine says AllSigned, you get RemoteSigned.

This is why a command can succeed and still change nothing. Set LocalMachine to Restricted while Group Policy says AllSigned, and PowerShell tells you your preference was saved but "overridden by the Group Policy applied to your system."

This January 2026 thread asks how to stop typing -Scope Process at the top of every run. The replies land on the right answers: set CurrentUser once, launch with -ExecutionPolicy for a single script, or sign your scripts.

PowerShell execution policy scopes in precedence order, MachinePolicy and UserPolicy from Group Policy above Process, CurrentUser and LocalMachine, with example Get-ExecutionPolicy -List output where CurrentUser RemoteSigned beats LocalMachine AllSigned

How to set the execution policy

For one user, no admin rights:

powershell

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

For the whole computer, from an elevated prompt:

powershell

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine

For a single script, without changing anything saved:

powershell

powershell.exe -ExecutionPolicy RemoteSigned -File .\script.ps1

Changes take effect immediately. You don't need to restart PowerShell. To clear a scope, set it to Undefined with the same -Scope .

Across a fleet, use Group Policy rather than a script that runs Set-ExecutionPolicy on every machine. The setting is Turn on Script Execution under Administrative Templates, Windows Components, Windows PowerShell, on both the computer and user side. "Allow local scripts and remote signed scripts" maps to RemoteSigned, "Allow only signed scripts" maps to AllSigned, and "Allow all scripts" maps to Unrestricted. Disabling the setting blocks scripts entirely. Computer settings win over user settings.

In Intune, platform scripts have an Enforce script signature check option. Turn it on and the script has to be signed by a trusted publisher. When a script behaves differently under Intune than it does on your desk, compare the policy the agent sees with what Get-ExecutionPolicy -List shows you. More remote checks like this live in our PowerShell commands guide.

Change log meme: in March 2019 Set-ExecutionPolicy Unrestricted -Force was run so one printer mapping script would work, the script was retired in 2021, and in 2026 an audit asks why every workstation is still Unrestricted

Fixing "running scripts is disabled on this system"

The full error reads "cannot be loaded because running scripts is disabled on this system." It means the effective policy is Restricted, or the script was downloaded and isn't signed. Work through it in order:

Run Get-ExecutionPolicy -List and find the highest scope that isn't Undefined.

If MachinePolicy or UserPolicy is set, Group Policy or Intune owns the answer. Fix it there, because anything you set locally is overridden.

If the script came from the internet, email or a chat app, Windows marked it as downloaded. Read the script, then run Unblock-File .\script.ps1 on that one file. Get-Item .\script.ps1 -Stream Zone.Identifier shows whether the mark is there.

If the machine is simply on the Restricted default, set CurrentUser to RemoteSigned. That fixes it for that user without touching anyone else.

One catch in step 3: Microsoft notes that files fetched with curl.exe , Invoke-WebRequest or Invoke-RestMethod may not get the downloaded mark at all. So RemoteSigned won't stop a script pulled down that way. That's one more reason not to treat the policy as protection.

On Windows Server Core, some PowerShell 6 setups fail with "AuthorizationManager check failed". The zone check needs the desktop shell, which Server Core doesn't have. Microsoft's workaround is Bypass or AllSigned, which skip the zone check.

Four steps to fix running scripts is disabled on this system: read Get-ExecutionPolicy -List, fix Group Policy if a policy scope is set, unblock one downloaded file after checking Zone.Identifier, or set CurrentUser to RemoteSigned, and never set Unrestricted fleet-wide

Why it isn't a security boundary

Lee Holmes, then on the Windows PowerShell team, called execution policies a user feature back in 2008: "Like seatbelts." Nothing since has changed that. Microsoft's PowerShell security features page lists the execution policy under defense-in-depth features, where a bypass isn't treated as a vulnerability.

The -ExecutionPolicy Bypass flag costs nothing to add, so it turns up in install instructions and fake "fix" prompts alike. This July 2026 thread shows the everyday version: an app telling a user to paste powershell -ExecutionPolicy Bypass -c "irm ... | iex" .

The top replies make the useful point. The script was fine that day, but piping a web page straight into PowerShell trusts whatever that server returns tomorrow. No execution policy setting changes that.

What to use instead

If the goal is stopping untrusted scripts, Microsoft points to application control:

App Control for Business (formerly Windows Defender Application Control). When a policy is enforced, PowerShell enters System Lockdown mode. Scripts the policy trusts run in full language mode, and everything else runs in Constrained Language mode. Microsoft classes this pairing as a security feature it services, unlike the execution policy. Our App Control for Business guide covers rolling it out in audit mode first.

Constrained Language mode. It blocks Add-Type with arbitrary C#, most .NET types and COM objects outside a short allow list. Setting it by hand is only for testing. It holds up only when App Control enforces it.

AMSI. Since PowerShell 5.1 on Windows 10, every script block goes to the Antimalware Scan Interface, so tools like Microsoft Defender see the script, however it was launched.

Script block logging. It records the commands, functions and scripts that ran in the Microsoft-Windows-PowerShell/Operational log, which is what you'll want during an investigation.

AppLocker can also force Constrained Language mode, but Microsoft lists that combination as defense in depth, not a serviced security feature. The same thinking shows up in Smart App Control , which gives unmanaged PCs a lighter version of the same allowlisting idea.

Microsoft's classification: execution policy, AppLocker-driven constrained language and hand-set language modes are defense in depth, while System Lockdown and constrained language enforced by App Control for Business are security features, with AMSI and script block logging adding visibility

A sensible baseline

For a typical business fleet, set RemoteSigned through Group Policy or Intune so nobody can drift away from it locally. Sign the scripts you deploy, so moving to AllSigned later is a small step. Keep Bypass for single runs launched by tools that have their own controls, never as a machine-wide setting. And if you need to know which machines still carry an old Unrestricted setting, Get-ExecutionPolicy -List answers it per device. OpenFrame can run that line as a script across a client's devices and collect the output in one place.

The short version

The execution policy in PowerShell stops accidental script runs, not attackers. Check Get-ExecutionPolicy -List before changing anything, fix Group Policy-owned settings at the source, unblock single files rather than loosening the machine, and set RemoteSigned centrally. For real control over which scripts run, use App Control for Business with Constrained Language mode, plus AMSI and script block logging.

If you're running scripts on remote machines, WinRM and PowerShell remoting is the next piece to get right.

Aliaska Varieva

VP of Engineering

Hi! I’m Aliaska, and I’ve been working as a software engineer (mostly Java + a bit Kotlin) for over 8 years now. I mostly spend my time building backend services, integrating systems, fixing bugs (the fun part 🙃), and making sure things don’t fall apart behind the scenes.

Related Content

Blog Posts

Product Releases

Podcasts

Webinars

Case Studies

Events

Onboarding Guides

Loading related content

Frequently Asked Questions

/blog/powershell-execution-policy

PowerShell execution policy

What is the PowerShell execution policy?

A Windows setting that decides whether PowerShell loads configuration files and runs scripts, and whether scripts must be signed. The values are Restricted, AllSigned, RemoteSigned, Unrestricted, Bypass, Default and Undefined. Microsoft describes it as defense in depth, not a security boundary: it prevents accidental script runs rather than stopping a determined user or attacker.

How do I fix "running scripts is disabled on this system"?

Run Get-ExecutionPolicy -List. If MachinePolicy or UserPolicy is set, change it in Group Policy or Intune, because local changes are overridden. If the script was downloaded, read it and run Unblock-File on that file. Otherwise set RemoteSigned for your user with Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser, which needs no admin rights.

What is the default PowerShell execution policy?

In Windows PowerShell 5.1, the default is Restricted on Windows clients and RemoteSigned on Windows Server. If every scope is Undefined, clients fall back to Restricted. On Linux and macOS, PowerShell 7 is always Unrestricted and the setting cannot be changed. Windows PowerShell 5.1 and PowerShell 7 keep separate settings.

Is Set-ExecutionPolicy Unrestricted safe?

It lets any script run, with only a warning for scripts from outside the local intranet zone, so it removes the one check RemoteSigned gives you on downloaded files. For a fleet, RemoteSigned set through Group Policy or Intune is the safer default. For real control over which scripts run, use App Control for Business, which puts untrusted scripts into Constrained Language mode.

AI agents

Which tickets can Fae and Mingo resolve on their own?

Fae takes requests from users on their own computers: slow machines, approved software installs, printer trouble and 'how do I' questions. Mingo works across the fleet: scripts, policies, queries, patching and incident response. Mingo also watches logs and devices around the clock and fixes problems before anyone files a ticket. Anything that needs judgment, or that your rules mark 'ask first', goes to a technician.

Security and trust

Is OpenFrame SOC 2 compliant?

Not yet. The SOC 2 audit is in progress, and this page tracks it live through Vanta: 22% complete as of October 2026. NIST CSF 2.0 and CMMC 2.0 are planned next. In the meantime, the controls already passing in continuous monitoring are listed on this page, and gated documents are available under NDA.

Customer stories

What results have MSPs reported with OpenFrame?

Numbers from the stories on this page, in the customers' own words. Utah Tech Repair was up and running in about 15 minutes with one PowerShell command. Phoenix IT Advisors pushed an installer to 16 devices with one Mingo request, and 15 worked. At Praesto, 5 to 10 minutes with Mingo gets as deep as he estimates would take him days. Mear Technology says the AI solved a problem he'd have spent about a week on.

Documentation

What does the OpenFrame documentation cover?

Everything needed to run OpenFrame: deployment guides, the CLI reference, architecture docs and admin guides. That includes self-hosted installs with the guided CLI, plus guides for remote access, MDM, patching and ticketing. Ask Mingo answers from the same docs, so a question in plain words often beats searching the index.

Privacy

Does Flamingo sell or share customer data?

No. Flamingo doesn't sell customer data and doesn't use it to train AI or machine learning models. When you make an AI request, only the data that answer needs goes to the model provider your team chose, and only to produce the response. Customer data never goes to advertising platforms, data brokers or resellers.

Will the AI do things without asking me?

Only what you allow. You set the rules: routine fixes can run on their own, everything else waits for your approval. Every action is logged.

Still deciding?

Ask Mingo answers from our docs and customer stories.

APPLICATION CONTROL

AUTOMATION

BEST PRACTICES

Subscribe to Flamingo Blog (RSS)

PowerShell commands

App Control for Business

Smart App Control

WinRM and PowerShell remoting

Additional pricing (as published)

Flamingo Raises $4.5M Seed Round · Led by Vertex Ventures, bringing total funding to $6.7M to build the open, AI-native layer for IT and security.