Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Aug 2015
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Windows 2012 Server: Task Scheduler job pauses when "Run As" user account is locked

    Hi All,

    At work I've been running many overnight jobs on my virtual Windows 2003 Server via Windows Task Scheduler without issue for years now. The jobs generally run MS Access applications so they must be "Interactive" (i.e. the "Run As" account must be logged on). The powers that be have demanded we upgrade to Windows 2012 Server and I've been working on testing/installation/set up for months, trying to get this new server into Production.

    I recently found a big problem. If the "Run As" user is logged on the task will start when triggered but if the screen is locked the job immediately pauses. It won't do anything but wait until the "Run As" user unlocks the machine. There are two avenues I have explored to try and work around this issue.

    1) Find a solution that will get Windows to run the job as usual while the "Run As" user is locked (as it has always worked on Windows 2003 Server).
    2) Change the appropriate settings so that the "Run As" user's instance will not be locked after 300 seconds (as is the default via Group Policy - at least in my company).

    I can't seem to find an answer to 1 which is the preferred solution. If anyone knows how to fix this I would be extremely grateful to hear it.
    As for 2, I can't seem to change the 300 seconds parameter for locking the user account. The setting I found is grayed out. Again, if anyone knows how to do this, I would appreciate them sharing.

    I am a programmer analyst, not a server admin, so I am definitely no expert on how to configure a new server. Please forgive me if I ask silly questions.

    Thanks everyone!
    Last edited by TrudiW; 2015-08-14 at 12:22. Reason: bad wording in subject line, causes confusion

  2. #2
    New Lounger
    Join Date
    Aug 2015
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Further details, in case it will help clarify:

    - This is an application server on the enterprise domain
    - I read online that I should install AD in order to get the Group Policy Manager tool. I did that and somehow lost the connection to the enterprise domain. I messed it up so bad that the Windows upgrade team had to rebuild the new W2012 server from scratch. Now I need to redo a ton of work.

    If I don't find a better solution I may just have to run a script every 5 minutes to send an action to the OS (ex. Numlock twice) so that the screen never locks but that seems ridiculous to me so I'm hoping someone here knows a better solution.

    Thanks again for any advice you can provide.

  3. #3
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,203
    Thanks
    49
    Thanked 989 Times in 919 Posts
    Why does it have to be interactive? If you set the scheduled job up with user credentials that have the correct access it should be fine. I assume you are using VBS or similar?

    p.s. You don't install AD to get the GPO tools, you just use Add Features. https://technet.microsoft.com/en-us/.../cc725932.aspx

    cheers, Paul

  4. #4
    New Lounger
    Join Date
    Aug 2015
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No. Not VBS. Most of the tasks run a .bat file that opens MS Access and a specific database and triggers the running of a macro (which generally simply calls the VBA function). I know it sounds crazy but you have to trigger a macro. You would think I could have identified the specific database and triggered a function to run (skipping a meaningless step).

    These are all Access apps that used to be ran manually by users but they didn't really require any user involvement other than to click the buttons to start the processes so the big bosses decided a few years ago that they wanted the processes to run during the night so that the data would be ready when the users arrived in the morning. Hence, the server was set up to run all of these tasks.

    Again, they all work fine other than the fact that if the screen is locked it pauses and waits until the user unlocks it before continuing. It seems like a bug to me. What's the point of having the app server if I can't set up jobs to run without my involvement.

    I will be setting up some simple file copy jobs using batch files and I'm pretty sure that there won't be a problem running them not-interactively. I'm also supposed to be getting another scheduling tool so I'll probably end up migrating the jobs out of Windows Task Scheduler. It's just a shame that something works so well in Windows 2003 and not in Windows 2012.

    Okay. I'll check out the article. Thanks Paul!

    Trudi

  5. #5
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,203
    Thanks
    49
    Thanked 989 Times in 919 Posts
    Have you tried running some VBS that invokes Access and runs the macro?
    http://stackoverflow.com/questions/2...ccess-instance

    p.s. I wouldn't touch GPO if it's not something you are familiar with, it can be tricky and you need domain/server admin permission to do anything.

    cheers, Paul

  6. #6
    New Lounger
    Join Date
    Aug 2015
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes. I've been doing this for 14 years and have pretty much tried every which way to start these things. I could do that. It's no problem to run a task using a .bat or .vbs trigger. It's what is inside that code. Any code that opens an MS Office app is immediately made "Interactive". I can't use Service IDs for these kinds of tasks either. I can use Service IDs to run non-interactive tasks like a simple file copy in a .bat file but it becomes interactive if what you are doing is opening an application instance of MS Access, Excel, etc. Does that make sense?

    Thanks. I am hesitant to mess things up again so if I don't figure out why it won't run while the screen is locked, I may just implement that code to send a key or two periodically to keep it from locking. I'll ask the Windows server guys if they can change the 300 seconds variable for me from their end (with their priviledges maybe that's possible).

  7. #7
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,203
    Thanks
    49
    Thanked 989 Times in 919 Posts
    You're auto-logging on as the user and then running the code, but need the screen locked to prevent der gefingerpokin. You could create a pseudo screen lock that prevents keyboard use.

    cheers, Paul

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •