Using regedit to view and set the PowerShell execution policy remotely

If you're looking to find out how Windows determines the execution for PowerShell the following maybe helpful.

Regardless of the version of PowerShell the following registry key is used.

ExecutionPolicy REG_SZ

This can be set to one of the following values and you can set this value remotely using regedit.

  • Restricted
  • AllSigned
  • RemoteSigned
  • Unrestricted       
  • Bypass
  • Undefined

However if Group Policy (either through the local Group Policy editor or using Active Directory) is  used the following setting override this.

ExecutionPolicy REG_SZ

It makes sense where possible to use the Group Policy template to modify the PowerShell execution settings

There are a couple of caveats to take into account when reading the setting remotely

  • If the Group Policy key exists and is set to a valid value then this is used
  • If the Group Policy key exists but is set to an invalid value then Restricted is used (the local machine setting is ignored).
  • If the Group Policy key exists but the value is empty the Group Policy setting is ignored and the local setting used.
  • If the registry key does not exist or is set to an unknown value then Restricted is used.

If this sounds a bit tiresome why not check out the latest version of our Windows and Network Audit Tool, XIA Configuration Server which will do all of the detection for you.


  1. Why not follow us on Twitter? @centrelsolution


Post a Comment

Popular posts from this blog

Install Microsoft Edge Browser on Windows Server 2016 and Windows Server 2019.

Unable to connect to iPhone personal hotspot using WiFi - "Cannot connect to network" and blue hotspot bar flickers on phone

Windows Server 2019 desktop icons such as My Computer, Windows cannot access the specified device, path, or file.