Whether on a Windows Server machine or Windows 11/10 client machine, you may get the error prompt with the message A specified logon session does not exist when you try to create a scheduled task using Task Scheduler. This post offers a practical solution to the issue.
When this error occurs on the computer, depending on the version of Windows, the following full message with the accompanying error code is displayed:
A specified logon session does not exist. It may already have been terminated. (Exception from HRESULT: 0x80070520)
An error has occurred for the task <TaskName>. Error message: The following error was reported: A specified logon session does not exist. It may have already been terminated.
According to affected users, the computer throws this error whether logged on as a Local Administrator, Domain Administrator, or any other user that had the right to log on locally.
Do you need admin rights to run Task Scheduler?
If an administrator created a scheduled task on a particular machine, any other logged-in user on the machine will require administrator rights to modify permissions to be able to enable or disable scheduled tasks in the Task Scheduler. If it’s a scheduled task that a non-admin user account has created, any user that’s logged on to the system can disable, delete, or edit the task.
Read: Task Scheduler Access is denied. Error code 0x80070005
A specified logon session does not exist – Task Scheduler Error
Upon investigations following numerous reports by affected computer users, it was revealed that the Task Scheduler error: A specified logon session does not exist will only occur if the Network access: Do not allow storage of passwords and credentials for network authentication security policy is enabled and you select the Run whether user is logged on or not security option on the General tab when creating a new task on the Windows server or client machine. It’s imperative to point out that, the error will not occur if the user selects the Run only when user is logged on security option on the General tab as passwords are not stored in this scenario.
How do you enable Run whether user is logged on or not?
When creating a scheduled task, if you want to run the task with the option Run whether user is logged on or not, then you have to activate the option Run with highest privileges. Once this option is activated on the system, the task will run whether the user is logged or not. You will have to do this every time a new job is created or edited through the Task Scheduler.
Read: Prevent others from creating Tasks in Task Scheduler in Windows
Investigations further revealed the error in view will most likely occur on machines running newer versions of the Windows operating system. On these versions of Windows, Task Scheduler uses Credential Manager to store the credentials of the account that is specified to perform a task. If the network access security policy identified above is enabled and applied, the Credential Manager cannot store the credentials locally, consequently, this error message appears.
Read: Windows Credential Manager loses credentials after reboot
As this is the case, the only applicable fix to resolve this issue is to simply set the referenced policy to disabled.
To perform this task, do the following:
- Press the Windows key + R to invoke the Run dialog.
- In the Run dialog box type secpol.msc and hit Enter to open Local Security Policy Editor.
- Inside the Local Security Policy Editor, use the left pane to navigate to the path below:
Security Settings > Local Policies > Security Options
- At the location, on the right pane, locate and double-click the Network access: Do not allow storage of passwords and credentials for network authentication policy to edit its properties.
- In the properties window that opens, set the radio button to Disabled.
- Click Apply > OK to save the changes.
- Exit Local Security Policy Editor.
That’s it!
Read next: Fix Task Scheduler failed to start, Event ID 101
Is disabling Task Scheduler safe?
It’s not recommended for PC users to disable this service – doing so, will impact essential functionality or prevent specific roles or features from functioning correctly. Below are some of the top Windows Task Scheduler alternatives:
- ActiveBatch Workload Automation.
- Redwood RunMyJobs.
- Stonebranch Workload Automation.
- JAMS Scheduler.
- VisualCron.
- Z-Cron.
- Advanced Task Scheduler.
- System Scheduler.
Read: Task Scheduler service is not available error on Windows.