%3CLINGO-SUB%20id%3D%22lingo-sub-375056%22%20slang%3D%22en-US%22%3ETask%20Scheduler%20Error%20%E2%80%9CA%20specified%20logon%20session%20does%20not%20exist%E2%80%9D%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-375056%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3E%20First%20published%20on%20TECHNET%20on%20Apr%2018%2C%202012%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CP%3EGood%20morning%20AskPerf!%26nbsp%3B%20Kapil%20Patry%20here%20from%20the%20Microsoft%20Platforms%20Support%20Team.%26nbsp%3B%20I%20am%20blogging%20today%20about%20an%20issue%20I%20recently%20worked.%26nbsp%3B%20This%20particular%20issue%20dealt%20with%20the%20creation%20of%20a%20task%20using%20Task%20Scheduler%20on%20a%20Windows%202008%20R2%20Server%20(can%20occur%20on%20Windows%207%20as%20well).%26nbsp%3B%20When%20I%20attempted%20to%20create%20a%20scheduled%20task%2C%20the%20following%20error%20appeared%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F92941i5A790B59E0EAE1EA%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ETask%20Scheduler%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EAn%20error%20has%20occurred%20for%20the%20task%20%3CTASK%20name%3D%22%22%3E.%20Error%20message%3A%20The%20following%20error%20was%20reported%3A%20A%20specified%20logon%20session%20does%20not%20exist.%20It%20may%20have%20already%20been%20terminated..%3C%2FTASK%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThis%20error%20came%20up%20whether%20I%20was%20logged%20on%20as%20a%20Local%20Administrator%2C%20Domain%20Administrator%2C%20or%20any%20other%20user%20that%20had%20rights%20to%20log%20on%20locally.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EAfter%20extensive%20research%2C%20I%20found%20that%20the%20above%20error%20will%20only%20occur%20if%20the%20following%20Security%20Policy%20is%20enabled%20and%20you%20select%20the%20%E2%80%9CRun%20whether%20user%20is%20logged%20on%20or%20not%E2%80%9D%20Security%20option%20on%20the%20General%20tab%2C%20when%20creating%20a%20new%20task%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSTRONG%3E%20SECPOL.MSC%20%7C%20Security%20Settings%20%7C%20Local%20Policies%20%7C%20Security%20Options%20%3C%2FSTRONG%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CB%3E%20Network%20access%3A%20Do%20not%20allow%20storage%20of%20passwords%20and%20credentials%20for%20network%20authentication%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F92942i97206FD614196C4E%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ETo%20resolve%20this%20issue%2C%20simply%20Set%20this%20policy%20to%20Disabled%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F92943i598942C05B874F08%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20new%20version%20of%20Task%20Scheduler%20(Windows%20Vista%20onwards)%20uses%20Windows%20Credential%20Manager%20to%20store%20the%20credentials%20of%20the%20account%20that%20is%20specified%20to%20perform%20a%20task.%26nbsp%3B%20If%20the%20%3CB%3E%20Network%20access%3A%20Do%20not%20allow%20storage%20of%20passwords%20and%20credentials%20for%20network%20authentication%20%3C%2FB%3E%20policy%20is%20enabled%20and%20applied%2C%20Credential%20Manager%20cannot%20store%20the%20credentials%20locally%2C%20thus%20this%20error%20message%20appears.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CB%3ENOTE%20%3C%2FB%3E%20you%20will%20not%20receive%20this%20error%20if%20the%20%E2%80%9CRun%20only%20when%20user%20is%20logged%20on%E2%80%9D%20Security%20option%20on%20the%20General%20tab%20is%20selected%20(we%20do%20not%20store%20passwords%20in%20this%20scenario).%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CB%3E%20Addition%20Resources%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CUL%3E%3CBR%20%2F%3E%3CLI%3E%3CA%20href%3D%22http%3A%2F%2Ftechnet.microsoft.com%2Fen-us%2Flibrary%2Fcc507860.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20Windows%20Vista%20Task%20Scheduler%20%3C%2FA%3E%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3E%3CA%20href%3D%22http%3A%2F%2Ftechnet.microsoft.com%2Fen-us%2Flibrary%2Fcc722152.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20Task%20Security%20Context%20%3C%2FA%3E%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3E%3CA%20href%3D%22http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fbb756979.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20Task%20Scheduler%202.0%20%3C%2FA%3E%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%3CP%3E-Kapil%20Patry%3C%2FP%3E%0A%20%0A%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-375056%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20TECHNET%20on%20Apr%2018%2C%202012%20Good%20morning%20AskPerf!%26nbsp%3B%20Kapil%20Patry%20here%20from%20the%20Microsoft%20Platforms%20Support%20Team.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-375056%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Etask%20scheduler%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1728187%22%20slang%3D%22en-US%22%3ERe%3A%20Task%20Scheduler%20Error%20%26amp%3B%238220%3BA%20specified%20logon%20session%20does%20not%20exist%26amp%3B%238221%3B%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1728187%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20for%20taking%20the%20time%20to%20post%20this!%26nbsp%3B%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fhtml%2Fimages%2Femoticons%2Fsmile_40x40.gif%22%20alt%3D%22%3Asmile%3A%22%20title%3D%22%3Asmile%3A%22%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
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

1 Comment
Visitor

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