none
Powershell GPO

    Question

  • I have set the execution policy in GPO to remoteSigned, and it is working fine, when I run the script from cmd prompt "powershell –f "

    If I right click the script and choose “run with PowerShell” it starts with this text in red

    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 executionpolicy of RemoteSigned

    The script is working, but it do not look right for a user of the script.

    Sometimes when I run the script “run with PowerShell” it prompts the user to overwrite policy, again no matter if I choose yes or no, the script will run.

    I am running on Windows 8.1 Update 1 x64, Powershell 4.0

    Do anyone know how to fix?

    Kind Regards

    Jens


    Jens Lund

    Thursday, February 26, 2015 4:55 PM

All replies

  • Hi Jens,

    Would you please run following PowerShell command and then let me know the result?

    Get-ExecutionPolicy -List

    In addition, please open Local Group Policy Editor and navigate to:Computer Configuration-> Administrative Templates-> Windows Components-> Windows PowerShell-> Turn on Script Execution. Please enable the setting and configure option Execution Policy: Allow all scripts, then check if this issue still exist.

    If any update, please feel free to let me know.

    Best regards,

    Justin Gu


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Monday, March 2, 2015 9:26 AM
    Moderator
  • Hi Justin

    Get-Executionpolicy –list

    Scope           : MachinePolicy

    ExecutionPolicy : RemoteSigned

    Scope           : UserPolicy

    ExecutionPolicy : Undefined

    Scope           : Process

    ExecutionPolicy : Undefined

    Scope           : CurrentUser

    ExecutionPolicy : Undefined

    Scope           : LocalMachine

    ExecutionPolicy : Undefined

    Changing local GPO did not have any effect

    Kind Regards

    Jens


    Jens Lund

    Tuesday, March 3, 2015 11:32 AM
  • Hi Jens,

    Would you please let us know current situation of this issue? Just check if above suggestion can help you. If any update, please feel free to let us know.

    Best regards,

    Justin Gu


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Tuesday, March 10, 2015 4:40 PM
    Moderator
  • Hi Justin

    My setings is the same, yes I can change the excecution policy by hand, but I do not want to.

    The senario is to have someone like a Servicedesk person to be able to run powershell scripts  on a users device, therefor it is not an option to have them set the excecution policy first. They should only rigt click the script an choose "run with Powershell"

    Kind Regards

    Jens

     


    Jens Lund

    Thursday, March 12, 2015 1:03 PM