Solved

powershell Security question

Posted on 2013-10-29
4
599 Views
Last Modified: 2013-10-29
I have added a post backup event in Cobian to execute a powershell script.  It is to add event to the event log indicating the backup job has completed

I get the following message:

File C:\Powershell\addCobian.ps1 cannot be loaded because running scripts is disabled on this system.

I run scripts on this machine all of the time with no problem and this script will run to completion when run on its own.  Anybody have any idea what the problem is?

Thanks for the help
0
Comment
Question by:c7c4c7
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 7

Expert Comment

by:SterlingMcClung
ID: 39609493
It likely has to do with the user environment in which the script is being executed.  Does Cobian give the option to choose which user account is used to run the script?  If not, it is likely running the script under the same user that the cobian service is running.  Are you able to run that script yourself?
0
 
LVL 40

Expert Comment

by:footech
ID: 39609566
There are different scopes under which the execution policy can be set.  Run Get-ExecutionPolicy -list to see all the settings.  See
http://technet.microsoft.com/en-us/library/hh849821.aspx
for a description of what the different scopes will affect.  Perhaps you have it set so that you're not running under restrictions when using your account, but the backup job is using something different.
0
 
LVL 70

Accepted Solution

by:
Qlemo earned 500 total points
ID: 39610358
In detail, you might have to issue
Set-ExecutionPolicy RemoteSigned -Scope LocalMachine

Open in new window

once to set the policy for the executing machine. You can also call PS itself with a temporary change to the execution policy in Cobian:
PowerShell -ExecutionPolicy Unrestricted -File C:\Powershell\addCobian.ps1

Open in new window

0
 

Author Closing Comment

by:c7c4c7
ID: 39610817
Very detailed, it worked perfectly

Thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

724 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