?
Solved

Scheduled task not running on 2008 server

Posted on 2013-11-18
11
Medium Priority
?
653 Views
Last Modified: 2013-11-18
I have a powershell script I'm trying to schedule.
I can kick it off manually, but it's not completing if I launch it from Task Scheduler (nor wait for it).
History shows it's running, but I even dropped a line at the start to kick out a test file, and it's not appearing.
Since I'm not getting any errors, I'm not sure where to start, but I've created the task as I've found it outlined elsewhere...
0
Comment
Question by:sirbounty
[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
  • 5
  • 4
  • 2
11 Comments
 
LVL 35

Assisted Solution

by:Joseph Daly
Joseph Daly earned 252 total points
ID: 39656820
In the options for the scheduled taks under actions it should read.

Start a Program

Program/Script
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Parameters
c:\location\powershell.ps1

Is this how you have it configured?
0
 
LVL 67

Author Comment

by:sirbounty
ID: 39656839
Have tried it that way, as well as with the -file parameter preceeding the script
0
 
LVL 35

Expert Comment

by:Joseph Daly
ID: 39656850
Can you post the script?
0
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

 
LVL 40

Assisted Solution

by:Subsun
Subsun earned 748 total points
ID: 39656888
If the script is working when you run it from PowerShell console then add the following line as the first line of script and run it from schedule teask.. once it's complete check the c:\temp\log.txt for error details..

start-transcript -path c:\temp\log.txt
0
 
LVL 67

Author Comment

by:sirbounty
ID: 39656914
xxdcmast - I can wipe out the entire script, leaving
'test' |out-file 'c:\temp\temp.txt'
and it doesn't work...

Subsun - the file isn't produced.
0
 
LVL 40

Accepted Solution

by:
Subsun earned 748 total points
ID: 39656990
That's strange or probably script is not running at all..  I would check if the account which you use to run script on task scheduler have proper permission to run the task. Second Try to run task with "Run with highest privileges" checked..
0
 
LVL 67

Author Comment

by:sirbounty
ID: 39657019
Run with highest is already checked.
Narrowing it down a bit, scheduling a simple cmd style dir listing redirect doesn't produce output either under that account.
What permissions are needed to run a task?
0
 
LVL 40

Assisted Solution

by:Subsun
Subsun earned 748 total points
ID: 39657230
I think logon as a batch job will do.. or just add the account to local admin group and test.. What does the schedule task history says?

Here is a reference for creating schedule task for Powershell script..
http://blogs.technet.com/b/heyscriptingguy/archive/2012/08/11/weekend-scripter-use-the-windows-task-scheduler-to-run-a-windows-powershell-script.aspx
0
 
LVL 40

Expert Comment

by:Subsun
ID: 39657249
Also check the PowerShell Execution Policy using command Get-ExecutionPolicy
0
 
LVL 67

Author Comment

by:sirbounty
ID: 39657263
Account belongs to a group providing Logon as a batch and locally...so I'm stumped.

The 'test' job shows

Task Scheduler failed to start "\test" task for user "****\******". Additional Data: Error Value: 2147943645.

(I do not have 'start in' values entered, so the 'remove quotes' solution won't work here)
0
 
LVL 67

Author Comment

by:sirbounty
ID: 39657404
Sometimes just asking the question will lead you to the answer...had a brain slip ;^)
I was using that account to access a local folder and the perms are set at the share level, so I just had to access it via a unc and it appears to be working.
Thanks for the help!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

649 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