Solved

Scheduled Task hangs at status The Task is Currently Running

Posted on 2010-08-23
9
1,655 Views
Last Modified: 2012-06-21
I have set up a task to backup our TMG configuration on our 2008R2 server.  It calls a CMD file to perform the work.  The CMD file works fine standalone, or if in the task and set to run only when the user is logged on.

If I set it to run Whether the User is Logged on or Not (with credentials for an administrative account supplied, and Run With Highest Privileges checked) the task hangs with a status of The Task is Currently Running.

Any suggestions please?
0
Comment
Question by:mohegantribe
  • 4
  • 4
9 Comments
 
LVL 8

Expert Comment

by:MarkieS
ID: 33501467
Does the CMD line or file use any mapped network drives?  
Can you implement the commands in a series of Task Sequence steps along the lines of :-

CMD.EXE copy \\servername\c$\filewanted.txt  \\serverdestinantionname\c$\filewanted,.txt

Think this will need a little more detail..
0
 

Author Comment

by:mohegantribe
ID: 33501582
The task action is: cmd.exe with the argument start "TMG Backup" "c:\backup forefront.cmd"

The CMD file contents are: importexport.vbs e c:\TMGBackups\backup%date%.xml

Running the CMD manually works.
Running the task with Run only when user is logged on works
Switching the task to Run whether user is logged on or not and setting the trigger 2 minutes out (won't run interractively) hangs status Task is currently running.
0
 
LVL 8

Expert Comment

by:MarkieS
ID: 33501682
It sounds like a batch file hang problem where the batch file is still running, waiting for some input, but SCCM cant tell what is happening with it until it finishes and gives an exit code.

As far as SCCM is concerned it has launched the command line and then lets the batchfile or vbs script get on with it.
This works fine when you are logged in as your enviroment variables such as %APPDATA%  %TEMP% etc etc are available for SCCM to use.

The batch file may error and is awaiting input or clarification.

You may have to specify fuller path details in your command lines to access what you are trying to run...

For example
The CMD file contents are: C:\WINDOWS\importexport.vbs e c:\TMGBackups\backup%date%.xml
0
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!

 
LVL 7

Expert Comment

by:celazkon
ID: 33502112
I had quite similar issue when running the powershell script as a scheduled task. In my case the problem was security-related, after I explicitly stated to run the task as user Administrator, it started working as expected. Even when my account was member of administrators group, it simply didn't run the script correctly. Since this solved the issue for me, I didn't waste time with finding out the specific reason for this behavior.
Hope it can help you.
0
 

Author Comment

by:mohegantribe
ID: 33502368
Markie

SCCM doesn't come into play here.
Even editing the path didn't help.  Still hung at running task
Contents of batch now:   c:\importexport.vbs e c:\TMGBackups\backup%date%.xml


Celazkon

Changing to local Administrator didn't help.  Still hung at running task
0
 
LVL 8

Expert Comment

by:MarkieS
ID: 33502521
So just a plain Scheduled Task - sorry to get wire's crossed!

Content of CMD file :-

Your line - importexport.vbs e c:\TMGBackups\backup%date%.xml

Should that be importexport.vbs e "c:\TMGBackups\backup date.xml" with quotes?

Does your VBS or XML files refer to any paths that could be misinterpreted or need quotes around it for long file names.
0
 

Accepted Solution

by:
mohegantribe earned 0 total points
ID: 33502548
I ended up calling the batch directly.

My initial testing was using my own account to verify whether it worked.  Switched user to a non-expiring password user for final task setting.

I found that the short date settings I'd set were for my logon only, and not the logon for the user I set the task to run with, and the "/" in the date hosed the works.

Setting the short date to use a "-" for the task user resolved.
0
 
LVL 8

Expert Comment

by:MarkieS
ID: 33502599
Nice one - well done..
0
 

Author Comment

by:mohegantribe
ID: 33503330
solved
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

Suggested Solutions

Title # Comments Views Activity
Mac Mail and Office 365. Mac Version 10.9.1 2 99
screensaver group policy 2 44
windows 2012 r2 standard  licensing re hyper-v 4 57
Help with internal NTP server 12 57
The way I use Experts Exchange to assist me in analyzing and diagnosing a problem is I first enter a Verbose Question at Experts Exchange like: Office 2007 will hang when opening and saving files I then launch WordPad (any text editor will do) an…
INTRODUCTION The purpose of this document is to demonstrate the Installation and configuration of the Data Protection Manager product. Note that this demonstration was prepared on the basis of Windows OS is 2008 R2 and DPM 2010. DATA PROTECTI…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

749 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