ByPass MachinePolicy and UserPolicy when executing unsigned powershell script file

Hi All,

On my machine i have AllSigned policy set for MachinePolicy and UserPolicy 

I am able to execute scripts in powershell ISE Windows except powershell script files.

Is it possible to override these 2 policies and execute unsigned powershell script file ?


 >Get-ExecutionPolicy -list

                                                                               Scope                                                                      ExecutionPolicy
                                                                               -----                                                                      ---------------
                                                                       MachinePolicy                                                                            AllSigned
                                                                          UserPolicy                                                                            AllSigned
                                                                             Process                                                                            Undefined
                                                                         CurrentUser                                                                            Undefined
                                                                        LocalMachine                                                                               Bypass



TIA

September 6th, 2015 10:01am

You can run PowerShell.exe with a script as an argument and also bypass the execution policy using the command line documentation below:

https://technet.microsoft.com/en-us/%5Clibrary/Hh847736.aspx

You could use something similar to "PowerShell.exe -file <pathtofile> -executionpolicy bypass

Free Windows Admin Tool Kit Click here and download it now
September 6th, 2015 2:00pm

Thanks Rich,

I was using the EXACTLY same approach. It did not work.  I am researching if it's possible to bypass using alternative approach.

Thank again

September 6th, 2015 10:59pm

Can you post the command that you used? What was the error message you received?

Free Windows Admin Tool Kit Click here and download it now
September 7th, 2015 3:29am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics