A Specified Logon Session Does Not Exist | Quick Fixes

“A specified logon session does not exist” means Windows cannot find a valid login for your action, often with network shares, tasks, or certificates.

If you see A specified logon session does not exist. It may already have been terminated. while opening a share, running a task, or binding a certificate, it feels like Windows just forgot who you are. The message is short, but the impact can range from a single failed copy to a broken website.

This guide walks through what that logon session message means in plain terms and gives clear steps you can follow. You will see where the error usually appears, quick checks that fix simple cases, and deeper fixes for network shares, Task Scheduler, and IIS or certificate issues.

A Specified Logon Session Does Not Exist Error At A Glance

Windows creates a logon session whenever an account signs in or authenticates to a resource. That session holds the security token, keys, and other data that prove your identity to the system and to remote machines. When the message a specified logon session does not exist appears, Windows is telling you that a session it expected to use is missing or no longer valid.

The full text often includes the line It may already have been terminated and may show error code 1312 or an HRESULT such as 0x80070520 or 0x80090301. In practice this shows up while you:

  • Access A Network Share — Opening a NAS, another PC, or a server path in File Explorer or from a script.
  • Run A Scheduled Task — Starting a job that uses stored credentials, especially with the option to run when not logged on.
  • Bind Or Use A Certificate — Adding an HTTPS binding in IIS or using a certificate that needs a private key.
  • Call A Remote Command — Mapping drives or copying files through PowerShell remoting or similar tools.

Sometimes the error comes from a one-off glitch and disappears after a restart. Other times, it points to a policy choice, a missing credential, or a certificate that no longer lines up with the account in use.

Where This Logon Session Error Usually Appears

The same message appears across different Windows features, which can be confusing. This quick table lines up the most common spots with a likely cause and a first move you can try.

Scenario Likely Cause First Move
Opening a NAS or server share Stored passwords blocked or missing Check network access policy and add a Windows credential
Task Scheduler job fails at start Task set to run with stored password while a policy blocks it Change task settings or relax the related security policy
Adding HTTPS binding in IIS Application pool account cannot reach the certificate private key Fix certificate store entry and private key permissions
Mapping drives over PowerShell remoting Double-hop authentication or blocked stored passwords Adjust delegation method or local policy for stored credentials

When you see a specified logon session does not exist more than once in the same spot, treat it as a configuration problem rather than a random glitch. The rest of this article focuses on the fixes that tend to give the biggest payoff for everyday Windows use.

Quick Checks Before You Change Settings

Before you dive into policy editors and certificate tools, it helps to clear out simple causes. These checks cost little time and often restore a healthy logon session without deeper work.

  • Restart The Computer — A restart clears stale tickets and cached sessions that can confuse network or certificate access.
  • Sign Out And Back In — Logging off your Windows account and signing in again forces a fresh logon session for that user.
  • Try A Different Account — If another account on the same machine can reach the resource, the problem sits with credentials or policy tied to the first account.
  • Check Time And Date — A large clock drift between your machine and a server can break authentication and lead to errors that look like missing sessions.
  • Test Simple Network Access — Open a plain HTTP site on the server or ping its name to confirm that the issue is about authentication, not basic connectivity.

If these checks change nothing and the message appears in the same place again, it is time to adjust how Windows stores credentials and how the resource uses your logon session.

Fixing This Logon Session Error On Windows

Most fixes fall into three clusters: allowing Windows to store credentials, giving it the right credentials for the resource, and adjusting how background tasks use stored passwords. This section stays with standard tools that you can reach on Windows 10 and Windows 11 Pro or Enterprise.

Relax The Policy That Blocks Stored Credentials

On many systems, the error starts after a change to local security policy or a group policy that forbids Windows from storing passwords for network authentication. That change helps security, but it also stops mapped drives, NAS access, and some tasks from reusing your logon session the way they expect.

  1. Open Local Security Policy — Press Win + R, type secpol.msc, and press Enter on a Pro or Enterprise edition.
  2. Browse To Security Options — Go to Local Policies > Security Options.
  3. Find The Network Access Entry — Locate Network access: Do not allow storage of passwords and credentials for network authentication.
  4. Set It To Disabled — Open the entry and choose Disabled, then apply the change.
  5. Restart Or Run Gpupdate — Restart the machine, or run gpupdate /force from an elevated command prompt.

If a domain policy manages this setting, the local change may not stick. In that case, your IT admin has to adjust the central policy or choose a different pattern for mapped drives and tasks on that machine.

Add A Windows Credential For The Server Or NAS

When the error appears while opening a share, Windows may not have any valid credentials for that server, or it may still hold an old pair that no longer works. Adding an entry in Credential Manager gives Windows a clean way to create the right logon session when you connect.

  1. Open Credential Manager — Press Win and type Credential Manager, then open it from Control Panel.
  2. Pick Windows Credentials — Switch to the Windows Credentials tab.
  3. Add A New Entry — Click Add a Windows credential.
  4. Fill In Server Name And User — Use the server name or IP address, and enter the user in the form SERVERNAME\username or DOMAIN\username.
  5. Save And Reconnect — Save the credential, then try connecting to the share again in File Explorer or from your script.

If you scripted a drive map or a remote copy, try running the same command interactively in a normal session first. Once the map works in that context, repeat it in the scheduled task or PowerShell remoting command with the same user and adjusted policy.

Adjust Task Scheduler Settings For Stored Passwords

Task Scheduler can trigger the same message when a job is set to run while you are not logged on, and a security policy blocks storage of the password. Windows then cannot build the logon session needed to kick off the task.

  1. Open Task Scheduler — Press Win and search for Task Scheduler, then run it as an administrator.
  2. Edit The Task — Find the task that fails with the error, right-click it, and choose Properties.
  3. Review General Tab Options — On the General tab, check whether Run whether user is logged on or not is selected.
  4. Change How The Task Runs — For testing, switch to Run only when user is logged on and run the task again.
  5. Use A Service Account If Needed — For tasks that must run in the background, ask your admin for a dedicated account with the right rights and a policy that allows stored credentials.

If the task runs fine when you are logged on but fails in the background, that strongly points to a policy or stored password problem, not to the script itself. Once the policy line and account choice match, the logon session error usually disappears for that task.

Fixes For Certificate And IIS Scenarios

On servers, A Specified Logon Session Does Not Exist appears a lot during HTTPS setup work. You may see it when you try to bind a renewed certificate to a site, when you switch an application pool identity, or when client certificate authentication is in play.

Repair Certificate Store And Private Key Access

If IIS cannot reach the private key for the selected certificate, it cannot build the secure session that HTTPS needs. That gap leads straight to the logon session message while you edit bindings or start the site.

  1. Confirm The Certificate Location — Open mmc.exe, add the Certificates snap-in for the Computer account, and check that the certificate sits under Personal or the store you expect.
  2. Re-Import If Needed — If the certificate is missing or looks broken, import a fresh .pfx file that includes the private key.
  3. Repair The Key Mapping — On some systems, running certutil -repairstore my in an elevated prompt reconnects the certificate to its key.
  4. Check Application Pool Identity Rights — In the Certificates snap-in, right-click the certificate, choose All Tasks > Manage Private Keys, and give the application pool identity read access to the key.
  5. Reapply The HTTPS Binding — Return to IIS Manager, edit the site bindings, and pick the repaired or renewed certificate again.

If the certificate error started right after you deleted an old, expired certificate, restore that older entry temporarily. Some systems still reference its thumbprint, and the new one only works after the old reference is cleared and the binding is saved again.

Handle Client Certificates And TLS Handshake Issues

When client certificates are involved, the logon session error often signals that the server could not complete the handshake with a trusted client identity.

  • Verify Trust Chain — Make sure the server trusts the root and intermediate certificate authorities that issued the client certificates.
  • Align TLS Settings — Confirm that the server and clients share at least one enabled TLS version and cipher suite that fits your security rules.
  • Check Revocation Settings — If revocation checking is required, confirm that the server can reach the CRL or OCSP endpoints for the issuing authorities.
  • Match Client Mapping Rules — In IIS, confirm that any rules that map client certificates to Windows accounts still match the certificates now in use.

Once the certificate chain, key access, and mapping rules line up, the server can build the logon session again, and the message should vanish from the binding and handshake steps.

Stopping This Logon Session Error From Coming Back

After you fix one outbreak of this message, it is worth taking a few small steps so it does not return during the next update, password change, or certificate renewal. These are simple habits that keep logon sessions healthy across network and server work.

  • Document Policy Changes — When you change local security settings or domain policies related to stored credentials, write down what changed and why so you can trace later issues.
  • Pair Tasks With The Right Account — Use accounts that are meant for background work on scheduled tasks, and avoid mixing those with personal sign-in accounts.
  • Review Certificates Before Renewal — Before you delete an expired certificate, check which bindings and services still reference it and adjust those first.
  • Test On One Machine First — Try new policies and login methods on a test machine before you apply them broadly, especially when they affect stored passwords.
  • Keep Login Methods Consistent — Avoid switching daily between many different sign-in methods for the same account on one device, which can confuse stored sessions and credentials.

If the error keeps returning even after you follow these steps, gather exact screenshots and notes about when it appears: the task name, share path, or site binding in play. With that detail, an experienced admin can match the issue to a specific policy, certificate entry, or delegation choice and clear up the remaining session problems.