theme-sticky-logo-alt

Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope

0 Comments

While working at a client on a Windows Server 2012R2 environment to create some PowerShell scripts, I had to change the Execution Policy, however running the “Set-ExecutionPolicy Unrestricted” command gave me the following error.

the setting is overridden by a policy defined at a more specific scope

Set-ExecutionPolicy : Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope. Due to the override, your shell will retain its current effective execution policy of RemoteSigned. Type “Get-ExecutionPolicy -List” to view your execution policy settings. For more information please see “Get-Help Set-ExecutionPolicy”.

 

The error can be quite confusing, what I did see first see what are the possible “more specific scopes” I can give to my command. By running the following command:

Get-ExecutionPolicy –List

I was able to see my available scopes.

So now that I have them all, usually to run PowerShell scripts you need to work with the MachinePolicy. So, the command in order to change the MachinePolicy ExecutionPolicy is

Set-ExecutionPolicy -Scope MachinePolicy Unrestricted

However, you might have an error saying it can only be done via Group Policy.

“Set-ExecutionPolicy : Cannot set execution policy. Execution policies at the MachinePolicy or UserPolicy scopes mustbe set through Group Policy.

If you get that error, read the resolution in my blog post: Change the PowerShell MachinePolicy Execution Policy in Windows Server 2012R2.

 

Leave a comment and don’t forget to like the Absolute SharePoint Blog Page  on Facebook and to follow me on Twitter here  for the latest news and technical articles on SharePoint.  Also, don’t forget to check out SharePoint Community.Net for more great SharePoint Content.

Previous Post
PowerShell Script to get all the Active Directory groups in your SharePoint Farm
Next Post
Meet me at a conference near you in 2015!

0 Comments

    Leave a Reply

    15 49.0138 8.38624 1 0 4000 1 https://vladtalkstech.com 300 1