Solved

powershell Security question

Posted on 2013-10-29
4
591 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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 following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
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ā€¦
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

732 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