Windows 11 22H2 upgrade breaks "Run whether user is logged on or not" scheduled tasks

Anonymous
2022-10-09T09:00:28+00:00

I have a number of scheduled tasks with the "Run whether user is logged on or not" option set, with the default setting of storing the password for the account.

Everything was running fine, until the 22H2 update.

Now such tasks won't start, yielding

"Task Scheduler failed to start "xxx" task for user "yyy". Additional Data: Error Value: 2147943726.

Re-entering the password for the (local) user account does not help.

If I check the "Do not store password" option the task can start, but this prevents the task from accessing network resources.

Repro'ed on two machines, so doesn't feel like a configuration issue.

Any clue?

Windows for home | Windows 11 | Accounts, profiles, and login

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

63 answers

Sort by: Oldest
  1. Anonymous
    2023-03-07T17:46:48+00:00

    I went ahead and wiped a laptop, installed the latest version of windows 11 22H2 and set task manager to run my Robocopy script. Task fails access denied error and the task never stops running. This script is used to copy data across network shares using the domain admin profile.

    If the script is executed manually, it runs fine and copies all the files correctly across network shares.

    I have the same task and Robocopy script running on some windows 11 21H2 and windows 10 21H2 boxes. The task and script work fine. I believe it's some kind of security / permission issue in 22H2 that is breaking my process. So, I am still in limbo with this issue and 22H2.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2023-03-07T18:29:50+00:00

    If the script is executed manually

    Assume "log on as batch job" is set in secpol, "start in" is a folder that the user can read/write, and the script works fine from a command prompt, but does the scheduled task with "Run whether user is logged on or not" run when kicked-off manually in the task scheduler?

    If not, does the task run if setting trigger to "At Log On", then assign the user running the task, and set "Run only when this user is logged-on" and see if that kicks off when you log in? This does not solve your issue but may be interesting to know if that at least works.

    You may also want to run your script on a physical machine outside of your existing set-up, just to be sure nothing crazy is going on with virtualization.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2023-03-07T21:15:36+00:00

    I went ahead and set run task when user is logged in as the domain admin, highest privileges. Robocopy log reports error, you do not have Manage Auditing rights. This is the domain admin profile that has full access to the folders and files.

    As I mentioned, script works fine when run manually copying everything with correct permissions.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2023-03-07T23:28:44+00:00

    "You do not have Manage Auditing rights" is a different error than "Access Denied" so you might be making progress.

    First, If you have UAC Enabled, turn it off fully to see if that's your issue:

    reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f
    

    Now, if you're running RoboCopy with /COPYALL, change it to /DATSO to skip audit rights.

    -OR-

    Add the necessary rights for the user in gpedit.msc:

    > Computer > Windows Settings > Security Settings > Local Policies > User rights > Manage auditing and security log

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2023-03-08T00:02:57+00:00

    I can confirm the same observations as @DanM... A machine loaded fresh with Win11 22H2 works fine. A machine upgraded from Win11 22H1 to 22H2 FAILS. Strangely, I also found that a machine upgraded from Win 10 to Windows 11 22H2 is also working fine.

    I am seeing the problem only with "existing accounts" on a machine upgraded from Win11 21H2 --> 22H2. The tasks don't run when a "stored password" is used, whether via schedule or "on demand". Without the stored password, the task runs but can't access network/server resources.

    On a machine exhibiting the issue, I did the following simple test to reproduce the issue:

    • Created a "test.bat" file with two lines, "timeout /T5" and "exit 0", located where all users have access.
    • Created a scheduled task that runs "cmd.exe /c <path>\test.bat" using my user account (member of administrators).
    • In all the following tests, the "Run with highest privileges" makes no difference -- same results with it set or cleared.
    • With "Run only when user is logged on" set:
      • Right-click task, "Run": Status changes to "Running", cmd window pops up, waits 5 sec, disappears. Clicking "Refresh" changes Status back to "Ready", and last result shows success (0x0). ALL GOOD.
    • With "Run whether user is logged on or not" set, and "Do not store password" set:
      • Right-click task, "Run": Status changes to "Running". (No cmd window appears.) Clicking "Refresh" repeatedly shows "Running" for 5s, then status changes to "Ready" and last result shows success (0x0). ALL GOOD.
    • With "Run whether user is logged on or not" set, and "Do not store password" cleared (and password entered when saving task):
      • Right-click task, "Run": NOTHING. Status does not change to "Running". No cmd.exe process runs. The "Run" action is simply ignored! The task will not run using my UserID when "Do not store password" is cleared (i.e., a Stored Password).
    • Used mmc "local users and groups" to create a new account named "TestUser" with password and member of Administrators (needed for "logon as batch file" rights). Never logged into this account interactively; just created the account, set a password and group membership.
    • Changed the above scheduled task to run using the new "TestUser" account and entered the password for TestUser when saving.
    • Task still has "Run whether user is logged on or not" set, and "Do not store password" cleared (i.e., a Stored Password).
      • Right-click task, "Run": Status changes to "Running", then after 5s a Refresh shows "Ready" and last result shows success (0x0). ALL GOOD. The task runs fine with a "stored password" from a NEW user account.

    The issue appears to be with "existing accounts" on Win11 machines upgraded from 21H2 to 22H2. New accounts work fine, but old accounts CANNOT RUN A TASK WITH A STORED PASSWORD.

    Was this answer helpful?

    0 comments No comments