?
Solved

Windows 2008 R2 - Schedule task not Running when logged off

Posted on 2013-05-24
9
Medium Priority
?
6,547 Views
Last Modified: 2013-07-02
Hi, We have the following environment

Windows 2008 R2 Server fully patched Terminal Server
Logging in as Domain admins

Issue:
Unable to run vb application via task schedule when set to run when either logged off or locked

Tests:
Ran schedule task to open notepad and notepad opens when you set the task to run only when logged on.

When we run the same task to open notepad but set to run when either logged off or locked  it doesn't open notepad but you can see the notepad.exe running in task manager.

So, I believe if wen can get notpad to open when the schedule task properties are set to run when logged off this will fix the issue with or vb program.

My hunch is it has something to do with Group policy or Security settings.  Even then the task is running as domain administrator and we are logged in as the domain administrator.

I have also tested on a windows 8 machine that is not part of the domain and the same issues occur

Cheers,
Troy
0
Comment
Question by:troyComp14
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 6

Expert Comment

by:BurundiLapp
ID: 39193766
From what you're saying it sounds like notepad.exe does run but you don't see the notepad window popping up, is that right as this is what I would expect if you are not logged in or the screen is locked, notepad is a program that requires user interaction so it requires an active desktop to display on.

Bringing up notepad is not a normal use for task scheduling, you would normally use it to perform maintenance tasks in the background that require no user interaction so this behaviour is normal.

What parameters in the run and startup fields are you using to launch the vb app?  I presume the VB app doesn't present any screens requiring user interaction when it is running as that would make it unsuitable for scheduling.

Does the vb app run fine from a command line on the same server?

Have you ticked the 'run whether user is logged on or not' tick box on the scheduled task?
0
 

Author Comment

by:troyComp14
ID: 39193838
All the testing is done when I am logged on viewing the screen and running the scheduled task manually.

We have this program on a number of servers and I am only aware of the issue on 2008 server.

The VB program has a /noui agrument which means no user interface is presented.  When we are testing we remove this argument to ensure the program actually opens up requiring user interaction so we can see if the task schedule is working probably.  On this particular server it doesn't happen, so we came up with the test from other forums to try and open up notepad from a schedule task to ensure it isn't the VB program.

To recap:
1) I am logged on the server as the domain administrator
2) I ran the task MANUALLY with the 'run whether user is logged on or not' tick box CHECKED.  Notepad doesn't launch
3) I run the task again with the "run whether user is logged on or no" tick box UNCHECKED
and Notpad Launches.

So I believe point 2) should work as I am logged on therefore notepad should lauch
0
 
LVL 6

Expert Comment

by:BurundiLapp
ID: 39193865
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 2

Expert Comment

by:Mike Schultz
ID: 39193975
In the scheduled task
under the Actions tab
select edit
In the field "Start in (Optional) - enter the location (folder) where the script sits that you are running

I has simuliar issue pulling info from an AD group and creating a txt file with that info.
Worked when launched manually but not from the scheduled task until I did the above.
0
 
LVL 57

Expert Comment

by:McKnife
ID: 39194600
Hi.

As said before: normal behavior. You are storing a password, so imagine the following scenario: someone else is logged on and the task starts notepad interactively (=visible)... this would enable that someone to act as another user... good-bye, security!
That's why notepad does not show up - it runs non-interactive for securiry reasons.
0
 

Author Comment

by:troyComp14
ID: 39249388
We still haven't been able to resolve the issue.

We have this application installed on hundreds of servers and it only seems to be an issue on 2008R2
0
 
LVL 57

Expert Comment

by:McKnife
ID: 39249698
Name one OS that displays it, please.
0
 
LVL 6

Expert Comment

by:BurundiLapp
ID: 39249844
I think we are getting away from the real issue which is the VB app is not working when the OP tries to run it as a scheduled task.  Lets forget about notepad not running and concentrate on the VB app.

Does wscript or cscript run at all when the scheduled task for the VB app runs?

Does it generate a failure error in the scheduled tasks manager, if so what is the code it is generating?
0
 
LVL 2

Accepted Solution

by:
Mike Schultz earned 1500 total points
ID: 39252858
Was this tired?

In the scheduled task
under the Actions tab
select edit
In the field "Start in (Optional) - enter the location (folder) where the script sits that you are running

I has simuliar issue pulling info from an AD group and creating a txt file with that info.
Worked when launched manually but not from the scheduled task until I did the above.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Detailed instructions on how to install an Access add-in in recent versions of Office and Windows (with screen shots)
For anyone that has accidentally used newSID with Server 2008 R2 (like I did) and hasn't been able to get the server running again because you were unlucky (as I was) and had no backups - I was able to get things working by doing a Registry Hive rec…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

864 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