?
Solved

powershell Security question

Posted on 2013-10-29
4
Medium Priority
?
618 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 2000 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

Bringing Advanced Authentication to the SMB Market

WatchGuard announces the acquisition of advanced authentication provider, Datablink, with one mission – to bring secure authentication to SMB, mid-market, and distributed enterprises with a cloud-based solution, ideal for resale via their established channel & MSSP community.

Question has a verified solution.

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

Utilizing an array to gracefully append to a list of EmailAddresses
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

765 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