Can’t Set-ExecutionPolicy when scope is MachinePolicy

Stuck on a machine that has a restrictive PowerShell execution policy that is set via Group Policy? Unfortunately you can’t just use Set-ExecutionPolicy to change the policy for the MachinePolicy scope.

But, if you can get to the HKLM hive (i.e. you’re a local admin), then you can very quickly wipe out any PowerShell policy settings. This will last until the GPOs are refreshed, but is still handy if you have a quick something to do…

Remove-Item HKLM:\Software\Policies\Microsoft\Windows\PowerShell

For more information, check out Vlad Catrinescu’s post which goes in to a bit more detail.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s