Schuled task will not run unless user is logged in


Recommended Posts

Well, I recently got a new job which requires Windows Server Boxen Wrangler skills. While I am knowledgable about Active Directory and its dirty little secrets, this is my first actual experience in a production environement on something other than NT4.

And well, second week, and I run into something that baffles my logic. Perhaps one of you less Unix-driven Windows admins might be able to help me there.

You see, we have a batch file that does some checking upon the workstations of the domain, which has to be ran on a few servers as a Task Scheduler job.

The task runs as DOMAIN\SomeUser (which exists for this very purpose).

The job was created on a member server, and the job will not run and fail. It lists a generic failure in the "logs".

Now now, I thought permissions were at cause, but we have an identically set-up server over here which works flawlessly.

Now here is the part that baffles my mind:

The job fails to run. I login as the said DOMAIN\SomeUser somewhere via Terminal Services, the job actually runs.

If I logout, it fails.

And no, before you ask, the batch file posseses not something such as popup dialogs or anything requiring input.

If I run the job as the Administrator (in the job properties) it work.

So, it works with elevated privileges, it works when the user is logged on somwhere, else it fails.

...

No, sorry, I know not what the hell is happening.

I have never encountered this before at All.

As I stated I have another server with an identical set-up which works flawlessly.

Anyone?

(NOTE TO SELF: We will now proceed to test once more if I asked something that nobody is able to figure out. I have asked six questions maybe on neowin since I joined -- none were answered :p)

It needs to be something that runs are a service in order for it to run while logged off.

It may be something that already runs as a service. If so, you can ignore the following. You can actually make anything run as a service, these instruction set "Second Copy" to run as a service, but you can adapt it for anything:

Running Second Copy as an NT Service

You can configure Second Copy to run as an NT Service if you have the SrvAny.exe utility that comes with Microsoft NT Resource kit.

1. Install Second Copy using defaults

2. Configure any profiles as necessary. Also, edit the options and uncheck the box "show progress" in the performance tab, and "show message box....." in the copy tab

3. Copy INSTSRV.EXE and SRVANY.EXE from the NT Resource Kit to C:\WinNT

4. Run "INSTSRV SecondCopy c:\WinNT\srvany.exe"

5. Using REGEDT32 find the following key:- HKEY_LOCAL_MACHINE\

SYSTEM

\CurrentControlSet

\Services

\SecondCopy

6. Create a new key called "Parameters"

7. Create a new REG_SZ value under it called "Application" and give it the value c:\Program Files\Second Copy 97\sc97.exe

(For Second Copy 2000 use c:\Program Files\SecCopy\SecCopy.exe)

8. Run Control Panel, Services, find the SecondCopy service and change the Startup settings for the service to log on as an account that has the relevant read/write permission for what you want SecondCopy to do (usually a member of the Backup Operators group should be okay).

9. Start the service.

Note: To run Second Copy interactively (to add/change profiles etc), you must stop/pause the service.

Well uhm... it's a scheduled task, not a service -- it is set up using the task scheduler...

And as far as I know, you don't need to do that.

And how would a service make something run every X hour every Y day...

Unless of course it is something new from 2003, because we have a 2k box that works fine...

Anyone?

mr_da3m0n -- here's the answer that you're looking for:

Check which GPOs are being applied to the server (is this a member server or a DC?)

Check the value(s) of: Computer Configuration--Windows Settings--Security Settings--Local Policies/User Rights Assignment--"Log on as batch job"

You'll need the username that the scheduled tasks are running under added.

Cheers :)

Edit part: If you're uncomfortable/unfamiliar with Group Policy (I see you're a prior NT4 admin) the you should really check out the Group Policy Management Console. It installs on an XP SP1 (or newer) workstation and lets you easily manage your GPOs (with Active Directory Users and Computers --ADUC-- as well).

It's a free download from Microsoft.

Edited by Z3romus
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Google Chrome 149.0.7827.115 (offline installer) by Razvan Serea The web browser is arguably the most important piece of software on your computer. You spend much of your time online inside a browser: when you search, chat, email, shop, bank, read the news, and watch videos online, you often do all this using a browser. Google Chrome is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier. Use one box for everything--type in the address bar and get suggestions for both search and Web pages. Thumbnails of your top sites let you access your favorite pages instantly with lightning speed from any new tab. Desktop shortcuts allow you to launch your favorite Web apps straight from your desktop. Chrome has many useful features built in, including automatic full-page translation and access to thousands of apps, extensions, and themes from the Chrome Web Store. Google Chrome is one of the best solutions for Internet browsing giving you high level of security, speed and great features. Important to know! The offline installer links do not include the automatic update feature. Download web installer: Google Chrome Web 32-bit | Google Chrome 64-bit | Freeware Download: Google Chrome Offline Installer 64-bit | Direct Link | 131.0 MB Download: Google Chrome Offline Installer 32-bit | Direct Link | 119.0 MB Download page: Google Chrome Portable Download: Chrome ARM64 | Direct Link View: Chrome Website | Release Notes Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Oh, it's happening on more than one dialog? This is the dialog that I'm unable to interact with.
    • WSCC - Windows System Control Center 10.0.3.8 by Razvan Serea Windows System Control Center is a free, portable program that allows you to install, update, execute and organize the utilities from various system utility suites. WSCC can install and update the supported utilities automatically. Alternatively, WSCC can use the http protocol to download and run the programs. WSCC is portable, installation is not required. Extract the content of the downloaded zip archive to any directory on your computer. Free for personal use. The setup packages and updates are downloaded directly from their author's website! This edition of WSCC supports the following utility suites: Windows Sysinternals Suite (including support for "Sysinternals Live" service) NirSoft Utilities Mitec and more... WSCC - Windows System Control Center 10.0.3.8 changelog: [NEW] update progress is now visible on the Windows taskbar [FIXED] fixed an issue with the Update dialog [FIXED] minor fixes Download: WSCC (64-bit) | 5.4 MB (Free for personal use) Download: WSCC (32-bit) | 6.3 MB View: WSCC Homepage | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • The level of stupidity at Google and Microsoft is beyond belief. All they are doing by killing this is forcing people to jump over to Firefox and ditch them all together, therefore giving Firefox the market boost it needs to finally crush them all in the end.
    • HWMonitor 1.64 by Razvan Serea HWMonitor is a hardware monitoring program that reads PC systems main health sensors : voltages, temperatures, fans speed. The program handles the most common sensor chips, like ITE® IT87 series, most Winbond® ICs, and others. In addition, it can read modern CPUs on-die core thermal sensors, as well has hard drives temperature via S.M.A.R.T, and video card GPU temperature. Special hardware monitors such as abit® uGuru and Gigabyte® ODIN™ power supplies serie are supported too. HWMonitor 1.64 changelog: Intel Arc G3 & G3 Extreme (Panther Lake). Intel Core Ultra 5 250KF Plus (Arrow Lake Refresh). AMD Ryzen 7 7700X3D (Raphael). AMD Ryzen AI Max+ 495, 492, 488 (Gorgon Halo). AMD Ryzen AI Max 490, 485 (Gorgon Halo). AMD Ryzen AI Max PRO 495, 490, 485, 480 (Gorgon Halo). AMD Ryzen 9 9950X3D2 (Granite Ridge). AMD Ryzen 9 PRO 9965X3D, PRO 9945 (Granite Ridge). AMD Ryzen 7 PRO 9755, PRO 9745 (Granite Ridge). AMD Ryzen 5 PRO 9645 (Granite Ridge). AMD Ryzen AI 7/PRO 450G/GE (Gorgon Point 2). AMD Ryzen AI 5/PRO 440G/GE (Gorgon Point 2). AMD Ryzen AI 5/PRO 435G/GE (Gorgon Point 3). Support of HUDIMM and HSODIMM memory modules. New themes. New real-time graphs. Download: HWMonitor 1.64 | 3.4 MB (Freeware) Download: Portable HWMonitor 1.64 | 2.7 MB View: HWMonitor Homepage | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • One Month Later
      Clizby earned a badge
      One Month Later
    • One Month Later
      Timaximus earned a badge
      One Month Later
    • Week One Done
      Timaximus earned a badge
      Week One Done
    • Rookie
      FBSPL went up a rank
      Rookie
    • First Post
      davidbazooked earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      495
    2. 2
      PsYcHoKiLLa
      171
    3. 3
      +Edouard
      163
    4. 4
      Steven P.
      86
    5. 5
      ATLien_0
      77
  • Tell a friend

    Love Neowin? Tell a friend!