Task Scheduler Error “A specified logon session does not exist”
Published Mar 16 2019 04:32 AM 235K Views
Microsoft
First published on TECHNET on Apr 18, 2012

Good morning AskPerf!  Kapil Patry here from the Microsoft Platforms Support Team.  I am blogging today about an issue I recently worked.  This particular issue dealt with the creation of a task using Task Scheduler on a Windows 2008 R2 Server (can occur on Windows 7 as well).  When I attempted to create a scheduled task, the following error appeared:



Task Scheduler


An error has occurred for the task <task name>. Error message: The following error was reported: A specified logon session does not exist. It may have already been terminated..


This error came up whether I was logged on as a Local Administrator, Domain Administrator, or any other user that had rights to log on locally.


After extensive research, I found that the above error will only occur if the following 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:


SECPOL.MSC | Security Settings | Local Policies | Security Options


Network access: Do not allow storage of passwords and credentials for network authentication



To resolve this issue, simply Set this policy to Disabled:



The new version of Task Scheduler (Windows Vista onwards) uses Windows Credential Manager to store the credentials of the account that is specified to perform a task.  If the Network access: Do not allow storage of passwords and credentials for network authentication policy is enabled and applied, Credential Manager cannot store the credentials locally, thus this error message appears.


NOTE you will not receive this error if the “Run only when user is logged on” Security option on the General tab is selected (we do not store passwords in this scenario).


Addition Resources



-Kapil Patry

7 Comments
Copper Contributor

Thank you for taking the time to post this! :smile:

Copper Contributor

Thank you for this info.

 

Copper Contributor

Excellent, thanks a ton.

 

Copper Contributor

Thank you for sharing!

 

This change might impact other application. is there any alternative to bypass this error? By adding account to server group or something?

Copper Contributor

Thank You!

Copper Contributor

Thank you! This was exactly our issue.  Cyber Security changed our policy and broke the Task Scheduler

Copper Contributor
Hi,
 
Most of time, "Network access: Do not allow storage of passwords and credentials for network authentication" is used to disable "sessions" Cached credentials (ability for the user to connect to the machine when no Domain Controller is available) but has a side effect: You cannot store the account's password in scheduled tasks. The problem is that this setting disables "sessions" cached credentials but also the Credential Manager (which is used among other things to store passwords in scheduled tasks).

Disabling this setting is often in contradiction with the company's security policy.
 
A workaround is to not use "Network access: Do not allow storage of passwords and credentials for network authentication" but use instead "Interactive logon: number of previous logons to cache (in case domain controller is not available)" and set the number of cached logons to 0. With this setting, you'll be able to save credentials in your scheduled tasks (Credential Manager is enabled) but the "sessions" cached credentials will be disabled.
Version history
Last update:
‎Mar 16 2019 04:32 AM
Updated by: