Powershell : "Run only script that you trust" message even after many modifications; I am going crazy ! :) RRS feed

  • Question

  • Hello,

    I have copy/paste a script found on Internet to a ps1 freshly created file. Then I have uploaded that file to my Netlogon.

    Powershell v2 is installed on my Wn7.

    Now I try to execute the command :

    powershell -executionpolicy bypass -file \\mydomain\blablablab\myfile.ps1. (even with -executionpolicy Unrestricted).

    But I always have a question from Powershell like "Run only script that you trust" and I have to type "Y" (Execute this time).

    From a 2008 server, I have modified the GPO for Powershell and set the execution policy to "Allow all scripts".

    Even like that I am still having the message.

    With streams.exe, I have "nothing" for my "file.ps1"

    Someone has an idea ?

    Thank you

    Wednesday, February 19, 2014 5:27 PM


  • Yes of course, I have searched a lot before asking and finally I found the issue.

    Because of my GPO set to unrestricted, the "-executionpolicy bypass " wasn't take into consideration; so after disabling this GPO, I was able to launch the PS1 file remotely :)

    • Marked as answer by Isabelle94000 Wednesday, February 19, 2014 5:47 PM
    Wednesday, February 19, 2014 5:47 PM

All replies