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

    • BleachBit 6.0.1 Beta by Razvan Serea When your computer is getting full, BleachBit quickly frees disk space. When your information is only your business, BleachBit guards your privacy. With BleachBit you can free cache, delete cookies, clear Internet history, shred temporary files, delete logs, and discard junk you didn't know was there. Designed for Linux and Windows systems, it wipes clean thousands of applications including Firefox, Microsoft Edge, Google Chrome, Opera, Safari, and more. Beyond simply deleting files, BleachBit includes advanced features such as shredding files to prevent recovery, wiping free disk space to hide traces of files deleted by other applications, and vacuuming Firefox to make it faster. Better than free, BleachBit is open source. BleachBit has many useful features: Delete your private files so completely that "even God can't read them" according to South Carolina Representative Trey Gowdy. Simple operation: read the descriptions, check the boxes you want, click preview, and click delete. Multi-platform: Linux and Windows Free of charge and no money trail Free to share, learn, and modify (open source) No adware, spyware, malware, browser toolbars, or "value-added software" Translated to 64 languages besides American English Shred files to hide their contents and prevent data recovery Shred any file (such as a spreadsheet on your desktop) Overwrite free disk space to hide previously deleted files Portable app for Windows: run without installation Command line interface for scripting and automation CleanerML allows anyone to write a new cleaner using XML Automatically import and update winapp2.ini cleaner files (a separate download) giving Windows users access to 2500+ additional cleaners Frequent software updates with new features Going beyond standard deletion of files, BleachBit has several advanced cleaners: Clear the memory and swap on Linux Delete broken shortcuts on Linux Delete the Firefox URL history without deleting the whole file—with optional shredding Delete Linux localizations: delete languages you don't use. More powerful than localepurge and available on more Linux distributions. Clean APT for Debian, Ubuntu, Kubuntu, Xubuntu, and Linux Mint Find widely-scattered junk such as Thumbs.db and .DS_Store files. Execute yum clean for CentOS, Fedora, and Red Hat to remove cached package data Delete Windows registry keys—often where MRU (most recently used) lists are stored Delete the OpenOffice.org recent documents list without deleting the whole Common.xcu file Overwrite free disk space to hide previously files Vacuum Firefox, Google Chrome, Liferea, Thunderbird, and Yum databases: shrink files without removing data to save space and improve speed Surgically remove private information from .ini and JSON configuration files and SQLite3 databases without deleting the whole file Overwrite data in SQLite3 before deleting it to prevent recovery (optional) BleachBit 6.0.1 Beta release notes: BleachBit 6.0.1 beta is now available for testing. This maintenance-focused release includes bug fixes, updated translations, and a range of safe enhancements. This release fixes a Windows security issue that could allow arbitrary file deletion during privileged cleaning (reported by Zeze with TeamT5). It also adds new cleaners (including a DNS cache cleaner, Claude Code, and Visual Studio Code forks), support for multiple Chrome and Edge profiles, new deep scan options for developer directories like node_modules and venv, and safer, faster file shredding. All Platforms Added cleaners for Claude Code, DNS cache, and many Visual Studio Code forks. Added support for multiple Chrome and Edge profiles. Chrome can now clean downloaded AI models. Deep Scan can optionally remove venv, __pycache__, node_modules, and .angular directories. Deep Scan is faster by skipping directories on the keep list. File shredding is safer, faster, and leaves fewer recoverable traces. Improved handling of cookies, symlinks, Unicode filenames, external processes, and configuration files. Improved Expert Mode warnings and long warning dialogs. Fixed crashes related to cleaner detection, invalid Unicode, and malformed cleaner data. Clipboard is now cleared automatically after shredding files via paste operations. Linux Added AppImage support. Added cleaners for Visual Studio Code, Codeium, Librewolf (.deb), Transmission (Flatpak), and Profanity. Improved Linux trash detection, including Snap-installed applications and mounted drives. Fixed Wayland root CLI issues and several Snap-related problems. Improved package dependencies, AppStream metadata, and desktop file handling. Fixed startup crashes when Python Requests is unavailable. Windows Fixed a security vulnerability that could allow arbitrary file deletion when cleaning with elevated privileges. Added %WindowsSystem% variable support. Improved clipboard clearing using native Windows APIs. Improved installer experience on unsupported Windows versions. Reduced installer size and improved application robustness. Fixed Unicode handling, filename anonymization, Git revision reporting, and splash screen stability. [full release notes] Download: BleachBit 6.0 | Portable | ~20.0 MB (Open Source) View: BleachBit Home page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • DriversCloud 12.1.6 by Razvan Serea With DriversCloud (formerly My-Config.com), you can explore your computer easily, safely and free. The application quickly scans your PC and identifies the hardware and software components. DriversCloud then establishes a list of the different drivers compatible with your OS and hardware. Download the drivers needed for the proper functioning of your computer. To detect your drivers, DriversCloud also displays a detailed summary of your hardware and software configuration, analyzes your BSOD, monitors in real-time your PC voltages and temperatures and lets you share your configuration online. Once the hardware components have been detected, you will be able to obtain with just a few clicks the latest drivers corresponding to the identified hardware. You can record your configuration on the site for free, and can get the corresponding URL to post the configuration to technical forums, e-mail and social networks. You can also download the detection result (the configuration) as a PDF file. To protect the user's privacy and data confidentiality, a 4-level confidentiality system was created that filters the XML marks and gives control to the user. The default level can be modified in the preferences. Using the maximum level will prevent the user from publishing his configuration and generating a corresponding PDF file. In non-connected mode, each XML configuration is stored on the server for one day (for practical reasons). However, you are given the opportunity to manually delete it. Created in 2004, and continually improved, My-Config.com has established itself on the web as a free service to PC users running Windows and Linux operating systems. The service is designed to work with the most common Internet browsers (Edge, Firefox, Chrome, Safari). Download: DriversCloud 64-bit | 20.0 MB (Freeware) Download: DriversCloud 32-bit | 18.9 MB Link: DriversCloud Home Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • One Month Later
      AndreaB earned a badge
      One Month Later
    • One Month Later
      agatameier earned a badge
      One Month Later
    • Week One Done
      agatameier earned a badge
      Week One Done
    • Week One Done
      ssd21345 earned a badge
      Week One Done
    • Contributor
      MarkHughes4096 went up a rank
      Contributor
  • Popular Contributors

    1. 1
      +primortal
      516
    2. 2
      +Edouard
      189
    3. 3
      PsYcHoKiLLa
      148
    4. 4
      ATLien_0
      96
    5. 5
      Steven P.
      76
  • Tell a friend

    Love Neowin? Tell a friend!