powershell throwing can not run script when testing from APC GUI

Posted on 2012-08-24
Last Modified: 2012-08-24
When attempting to run my batch file from the APC gui, which calls my powershell shutdown script, I am receiving the following error:

script.ps1 cannot be loaded because the execution of scripts is disabled on this system
catagoryinfo :notspecified: PSSecurityException
FullyQualifiedErrorId :runtime Exception

I can run this script separate from the APC power chute software, and I have tried setting the ExecutionPolicy to RemoteSigned and Unrestricted with the same results

Is there some other security setting I am missing?

Side note: I have it running under local system account with Allow service to interact with desktop enabled. I get the same results if I use a domain account also

Question by:progjm
    LVL 8

    Accepted Solution

    Hi progjm,

    I assume the batch file contains something like this:
    powershell.exe c:\shutdown.ps1

    Open in new window

    Try replacing it with this:
    powershell.exe -executionpolicy unrestricted c:\shutdown.ps1

    Open in new window


    LVL 1

    Author Comment

    That did it, thank you!
    LVL 8

    Expert Comment

    My pleasure, thanks for the quick accept!


    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Hi all.   The other day I had to change the passwords for a bunch of users on the fly. Because they were so many, I decided to do it in an automated way and I would like to share it with you all.   If you are not doing it directly in a Domain Co…
    I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
    The viewer will learn how to count occurrences of each item in an array.
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now