User's password has expired on a NLA-enabled Windows Server system

System: Windows Server 2008R2/2012R2

- last updated on -

About: The purpose of this document is to detail the resolution of a situation that deals with a user's inability to login to a Server 2008R2/2012R2 system for no apparent reason; note that it is assumed that the system is not part of a domain (non-domain joined).

Symptoms and context: Logging in to the server (supplying the proper username and password) returns, instead of the expected Remote Desktop session, an error message which reads:

An authentication error has occurred. The Local Security Authority cannot be contacted.

The issue is encountered when the following two conditions are fulfilled:

  1. the user account's password has expired or the account has simply become locked due to multiple incorrect login attempts

  2. and

  3. the underlying system is employing Microsoft's NLA technology (see the Wikipedia article for a succinct account of what NLA is, or see this Technet entry for a more detailed one); NLA comes enabled by default on Server 2012R2 systems, but it has to be manually enabled on 2008R2, which makes it less likely for the issue to be encountered on such systems

Root cause analysis: What happens, due to NLA, is that the user gets prompted for his credentials (at his end) by the RDP Client, which in turn packages and presents them to the server - if they are correct, the server opens the RDP connection proper and presents the user with a login screen (on which, usually, there is no need to input the credentials again) and the subsequent terminal session (the Desktop). But, if the credentials are not correct - because they have expired, for instance -, then the server simply refuses the connection and the user is never presented with the login screen which would allow him to change his expired password. As such, an user account that has an expired password can no longer login to a Server system that employs NLA - this is not a bug, but a consequence of the technology (it's a feature, as it were).

Resolution: Solving the issue mostly comes down to a password reset, with the additional effort of paying attention to a few details, due to the usual corporate context and good practices when it comes to a user's password. What follows is a step by step account of the process:

Notes: 1. %userAccount% denotes the username of the affected account (for example, itataru).

2. According to the 1st and 2nd references, especially the second, there exists an undocumented /logonpasswordchg: boolean switch (the values are 'yes' and 'no', with 'no' being the implicit value) for the net user tool. Unfortunately, this does not simplify the process because a password change cannot be executed through the establishment of an NLA-enabled RDP session, as explained in the 3rd reference link, meaning that the usefulness of this switch is negated in this scenario, forcing the use of the convoluted method described here.

References:

  1. https://www.lifewire.com/net-user-command-2618097
  2. http://blog.johnmuellerbooks.com/2011/04/12/working-with-net-user
  3. https://serverfault.com/questions/604811/how-is-the-change-password-at-next-logon-requirement-supposed-to-work-with-rdp#605016