Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

Powershell script fails when ran as a task

Created: 11 Jul 2013 • Updated: 17 Jul 2013 | 4 comments
This issue has been solved. See solution.

Hello everyone,

I got a powershell script that copies a file from one network drive to another. Both network drives are mapped in the script.

When I run the powershell script locally on my computer via the Powershell command, the script executes successfully. But when ran as a task, the script faiils , it does not copy the file to the destination location. The script is ran using the default symantec management agent account. I use same account used to deploy software packages without any problems.

With scirpts like powershell, would we need "special" elevated rights?

please advise

thank you in advance

Operating Systems:

Comments 4 CommentsJump to latest comment

andykn101's picture

I think you need to do things like allow unsigned scripts to run:

set-executionpolicy remotesigned

Authorised Symantec Consultant (ASC) with Endpoint Management Limited, an Authorised Symantec Delivery Provider based in the UK.

Connect Etiquette: Please "Mark as Solution" posts that fix your problem.

SOLUTION
efyuze's picture

thank you andykn101 for your reply.

on my computer, execution policy is already set to "unrestricted". besides, when the script is ran locally on my computer via the Powershell console, it works (the file is copied to destination drive) but when ran as a script task, it fails.

efyuze's picture

I tried running the script (via Altiris) with my user account and it was successfully executed. I have a system account

so I guess I have to confirm if our Altiris Agent (which is a service account) has rights to run Powershell scripts.

 

efyuze's picture

did some changes to my script, ran it on Altiris and works fine, with the symantec agent account. dont know but maybe there was a bug in my script :-)